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.
License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
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 appearingSolution:
Create a single class which wraps a
SyntaxError
, calledAwsClientResponseError
. 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 anAwsClientResponseError
. This new class can only be created if given the correct SyntaxError instance toAwsClientResponseError.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.
License: I confirm that my contribution is made under the terms of the Apache 2.0 license.