-
Notifications
You must be signed in to change notification settings - Fork 59
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
LEGAL_API: 5xx return masking Auth and other Errors #2143
Labels
ENTITY
Business Team
Comments
This was referenced Nov 29, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
A 5xx error is being returned by the server, instead of a 4xx error
The correct error is generated (as seen in the log):
flask_jwt_oidc.exceptions.AuthError: ({'code': 'authorization_header_missing', 'description': 'Authorization header is expected'}, 401)
But the error handler that ensure messages are sent to Sentry is then swallowing this error and message and raising a new 5xx error that is returned to the caller.
The error handler should be changed to re-raise the error if it is appropriate to deliver the caller, or if it is truly an unhandled exception, log to sentry and return a 5xx.
To Reproduce
Steps to reproduce the behavior:
curl https://{host-env}/api/v1/businesses/CP0000088/filings?some junk
Expected behavior
valid response or a 401
The text was updated successfully, but these errors were encountered: