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

Add endpoint error handling #474

Merged
merged 5 commits into from
Aug 19, 2024
Merged

Add endpoint error handling #474

merged 5 commits into from
Aug 19, 2024

Conversation

seallard
Copy link
Contributor

@seallard seallard commented Aug 16, 2024

This PR removes a lot of duplicated error handling logic in the endpoints by extracting it to a separate error handler.

The code is easier to read since the indentation is decreased, duplicated logic is removed, fewer overall lines of code and improved separation of concerns 👍

Additionally, it:

  • Ensures we do not return stack traces in the error response (security risk) but just log them instead.
  • Ensures the correct HTTP status is returned for internal server errors (should not be 409 for a blank catch-all exception).

@seallard seallard requested a review from a team as a code owner August 16, 2024 08:31
Copy link

Copy link
Contributor

@ChrOertlin ChrOertlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job!

@clingen-sthlm clingen-sthlm temporarily deployed to stage August 19, 2024 09:56 Inactive
@seallard seallard merged commit 773badd into master Aug 19, 2024
5 checks passed
@seallard seallard deleted the add-endpoint-error-handling branch August 19, 2024 09:58
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.

4 participants