Skip to content

Do not cast error values to String#421

Merged
jimmyjames merged 1 commit intomasterfrom
iss-410
Apr 19, 2022
Merged

Do not cast error values to String#421
jimmyjames merged 1 commit intomasterfrom
iss-410

Conversation

@jimmyjames
Copy link
Copy Markdown
Contributor

As raised in #410, there are (rare) occasions when the Auth0 error responses are not strings. We construct an APIException from the response when there is a response body (see here), passing in a map of <String, Object> values parsed from the response.

When constructing the APIException, we set the description and error using the values, but casting them to a String (see here).

This change sets the description and error by calling toString() on the object if not null, else sets it to null.

Fixes #410.

@jimmyjames jimmyjames added this to the v1-Next milestone Apr 14, 2022
@jimmyjames jimmyjames requested a review from a team as a code owner April 14, 2022 17:24
@jimmyjames jimmyjames merged commit 01d92b9 into master Apr 19, 2022
@jimmyjames jimmyjames deleted the iss-410 branch April 19, 2022 13:53
@jimmyjames jimmyjames modified the milestones: v1-Next, 1.41.0 Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SDK ClassCastException during downtime

2 participants