Skip to content

Fix error handling for http errors everywhere#1

Merged
px-amaac merged 1 commit into
masterfrom
fix_error_handling_in_service_discovery
Sep 18, 2019
Merged

Fix error handling for http errors everywhere#1
px-amaac merged 1 commit into
masterfrom
fix_error_handling_in_service_discovery

Conversation

@px-amaac

Copy link
Copy Markdown
Owner
  • This commit adds check for response codes >= 400 on registration request and service configuration request and brings token request to use the same format
  • Creates TYPE_HTTP_ERROR(5) in AuthorizationException
  • Add method to create AuthorizationException of HTTP_ERROR type from http response code and message. Using HttpURLConnection.getErrorStream() to fill out errorDescription.
  • Add tests for each area changed to handle a bad request http error.

This PR follows in line with what was done for openid#144 following Android documentation and Recommendations from Oracle on handling http error responses here. The change in openid#144 did not address this issue in other places of the library and could potentially throw json exception if error stream does not contain a valid JSON response.

This commit adds check for response codes >= 400 and creates a new type of response for HTTP errors.
Add tests for each area changed to handle a bad request http error.
@px-amaac
px-amaac merged commit 11919d3 into master Sep 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant