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

Report exceptions as HTTP 500 #6005

Merged
merged 3 commits into from
Sep 18, 2020
Merged

Report exceptions as HTTP 500 #6005

merged 3 commits into from
Sep 18, 2020

Conversation

psteckler
Copy link
Member

In Rosetta, trap exceptions in the router, and report as HTTP 500 responses. Such exceptions are unexpected internal errors, so the 500 code is appropriate.

The endpoints in the Rosetta Construction API and Data API (see, e.g., https://www.rosetta-api.org/docs/ConstructionApi.html) give specific JSON objects when an error occurs, along with a 500 code. We should already be responding with those. The errors reported by the code in this PR are distinct from those errors, but in the same vein. The thing is, don't crash.

Adds a new constructor Exception to Errors.Variant, at the end, so the order of existing constructors is preserved.

Closes #5930.

@psteckler psteckler requested a review from a team as a code owner September 17, 2020 20:42
@psteckler psteckler added ci-build-me Add this label to trigger a circle+buildkite build for this branch ready-to-merge-into-develop labels Sep 17, 2020
@netlify
Copy link

netlify bot commented Sep 18, 2020

Preview:

Built with commit da6ad26

https://deploy-preview-6005--o1website2.netlify.app

@mergify mergify bot merged commit 0642c6f into develop Sep 18, 2020
@mergify mergify bot deleted the rosetta/trap-and-report-exns branch September 18, 2020 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-build-me Add this label to trigger a circle+buildkite build for this branch ready-to-merge-into-develop
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make rosetta endpoints resilient to crashes
3 participants