There is a small edge case where there are SOMETIMES missing fields in a SyntaxError, in this case the $response or its reason field do not exist. Due to this those cases are causing a connection to become invalid when refresh credentials fails.
Solution:
Handle the case where those fields are missing and gracefully handle them by still marking it as an AwsClientResponseError. Since we cannot extract the underlying error message, we set a custom errors message for those cases.
Now this will not cause a failed refresh credential to invalidate.
License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
Problem:
There is a small edge case where there are SOMETIMES missing fields in a SyntaxError, in this case the $response or its reason field do not exist. Due to this those cases are causing a connection to become invalid when refresh credentials fails.
Solution:
Handle the case where those fields are missing and gracefully handle them by still marking it as an AwsClientResponseError. Since we cannot extract the underlying error message, we set a custom errors message for those cases.
Now this will not cause a failed refresh credential to invalidate.
License: I confirm that my contribution is made under the terms of the Apache 2.0 license.