Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap OAuth 400 errors in Dnsimple::OAuthInvalidRequestError #336

Merged
merged 2 commits into from
Mar 9, 2023

Conversation

DXTimer
Copy link
Contributor

@DXTimer DXTimer commented Mar 7, 2023

Our standard request error class Dnsimple::RequestError does not support parsing OAuth request errors as their payload schema follows RFC 6749.

This PR detects 400 exceptions in the OAuth endpoint and re-packages the exception as Dnsimple::OAuthInvalidRequestError which correctly parses the error and exposes #error and #error_description methods to read the exception.

Fixes #103

@DXTimer DXTimer requested a review from a team March 7, 2023 08:00
@DXTimer DXTimer self-assigned this Mar 7, 2023
@DXTimer DXTimer requested a review from jacegu March 7, 2023 08:02
@DXTimer DXTimer merged commit 813bc4b into main Mar 9, 2023
@DXTimer DXTimer deleted the fix/gh-103-oauth branch March 9, 2023 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle OAuth errors properly
2 participants