-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feat: domain error handler #159
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to separate Domain Errors and other 5xx errors. Domain Errors — special exceptions provided by business logic in domain level.
- Create DomainError entity
- Change default Errors trown in a domain-level to DomainErrors
- Catch DomainErrors in
setErrorHandler
and reply with special format - All other errors should be throwed as usual
1daa1d4
to
38f2c23
Compare
decorator domainError status code changed to 400 added a real try-catch example
Have you updated all existing domain exceptions? I see only Note service |
There were also some todo's left for domain-errors catching. They should be resolved and removed in this PR |
I found only one todo about this. Other tudo's contain either other tasks or are not at the domain level (like todo in |
Added a decorator for custom errors and a domain-level error handler. Now if a domain-level error is received, it will be categorized in a certain way.