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).
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: