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

Determine exception type by error type first #1362

Conversation

pakrym-stripe
Copy link
Contributor

@pakrym-stripe pakrym-stripe commented May 24, 2022

Right now we are using status codes to determine the exception type which causes issues like #1358 where invalid_request_error was returned with 402 status code.

Change the error-handling logic to look at the error type first but keep the old status code-based logic as a fallback.

Add a bunch of tests.

Fixes: #1358

@richardm-stripe richardm-stripe removed their request for review October 14, 2022 23:03
@pakrym-stripe
Copy link
Contributor Author

This will have to be done consistently across all languages.

@remi-stripe remi-stripe deleted the pakrym/Determine_exception_type_by_error_type_first branch September 28, 2023 16:24
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.

invalid_request_error mapped to CardException not InvalidRequestException
2 participants