forked from aws/aws-toolkit-vscode
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(auth): SyntaxError not being considered Network Error (aws#5512)
## Problem: There were some previous changes that caused the existing implementation of a `SyntaxError` to not be considered a Network Error. And during token refresh we were seeing SyntaxErrors still appearing ## Solution: Create a single class which wraps a `SyntaxError`, called `AwsClientResponseError`. Under the hood of a SyntaxError is the real error that originates from a failed AWS SDK Client response, this is how we determine if it should be an `AwsClientResponseError`. This new class can only be created if given the correct SyntaxError instance to `AwsClientResponseError.instanceIf()`. Then we can simply check if an error matches by using `instanceif AwsClientResponseError` Any existing code that was related to this scenario has all been centralized in to the AwsClientResponseError class. --- <!--- REMINDER: Ensure that your PR meets the guidelines in CONTRIBUTING.md --> License: I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Signed-off-by: Nikolas Komonen <[email protected]>
- Loading branch information
1 parent
7e948c5
commit 56507e2
Showing
6 changed files
with
99 additions
and
50 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
packages/amazonq/.changes/next-release/Bug Fix-54ae3b04-fe8b-40e8-866a-7f9f73f3c7cb.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"type": "Bug Fix", | ||
"description": "Auth: `SyntaxError` causing unexpected SSO logout" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/toolkit/.changes/next-release/Bug Fix-48f605af-ae0d-477f-b1bb-1691b64ad96c.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"type": "Bug Fix", | ||
"description": "Auth: `SyntaxError` causing unexpected SSO logout" | ||
} |