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

Return Auth/Config Error in PayPalClient #849

Merged
merged 4 commits into from
Dec 12, 2023
Merged

Conversation

sarahkoop
Copy link
Contributor

Summary of changes

  • Propagate errors fetching configuration (which propagates authorization errors under the hood) to PayPalListener when auth is invalid or config is unable to be fetched, rather than returning a generic error message that PayPal is not enabled.
  • Note: This will return the merchant's own auth error defined in their ClientTokenProvider if an error is thrown at that level, or will propagate config fetching errors or other auth errors (ex if ClientTokenProvider is null).
  • Fixes Calling onFailure Results Exception Stating Paypal is Not Enabled #821

Checklist

  • Added a changelog entry

Authors

@sarahkoop sarahkoop requested a review from a team as a code owner December 11, 2023 17:24
@sarahkoop sarahkoop changed the title Paypal error description Return Auth/Config Error in PayPalClient Dec 11, 2023
@sarahkoop
Copy link
Contributor Author

Would we prefer to wrap the merchant's error defined in ClientTokenProvider with our own error message, or just propagate it back to them? Wrapping the error would have implications across the entire SDK if we changed BraintreeClient or AuthorizationLoader implementation,.

@tdchow
Copy link
Collaborator

tdchow commented Dec 11, 2023

Would we prefer to wrap the merchant's error defined in ClientTokenProvider with our own error message, or just propagate it back to them? Wrapping the error would have implications across the entire SDK if we changed BraintreeClient or AuthorizationLoader implementation,.

It might reduce merchant debug time if we just propagate the same exception. If we were to wrap the error, the merchant would need to go one level deep in the stacktrace to see that it was their error in the ClientTokenProvider.

@sarahkoop sarahkoop merged commit 3e30714 into main Dec 12, 2023
2 checks passed
@sarahkoop sarahkoop deleted the paypal_error_description branch December 12, 2023 15:38
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.

Calling onFailure Results Exception Stating Paypal is Not Enabled
3 participants