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

Generate errorResponse via built-in helper function to custom errors #159

Open
gr812b opened this issue Jan 9, 2025 · 0 comments
Open

Comments

@gr812b
Copy link
Collaborator

gr812b commented Jan 9, 2025

Related to #149

Currently we manually create an errorResponse object in the ExceptionMapper. This pattern worked when we were dealing with effectively random errors that could be thrown in any way. Now that we've converted to ensuring all errors are custom thrown ones, we should be able to generalize this to instead make use of a custom function. By adding a function to the base custom error, and letting all sub-errors inherit this method, all errors can be converted to an ErrorResponse in a clean manner.

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

No branches or pull requests

1 participant