Advise on handling Exceptions
gang89 opened this issue · comments
Hi guys,
Thanks for sharing this project with the community. Have benefited a lot from here just by studying and trying out the project structure.
Would like to clarify regarding the handling of exceptions for this project. It seems like any exceptions that are found in the domain layer is not able to be captured by a global exception.
Example:
In one of my domain model constructor - I were to deliberate throw an exception
I would expect it to be caught by a global exception handler such as below and returns an error
However, the API constantly returns a 200 OK success with no error message (probably because I didnt use the domainNotification Bus).
I also tried implementing along with GlobalExceptionFilter / Exception Middleware but to no avail.
It seems like the system exceptions are not surfaced to the API project Exception Handlers.
Have been looking for solutions for a few days now. Hence any advise would be greatly appreciated.
Regards,
@gang89 We try to avoid exceptions for known reasons. You can let validations do all the work and they will publish error notifications