Open h1alexbel opened 6 months ago
But for now our custom exceptions are already inherited from ResponseStatusException
. Why would it be better to replace it with HttpStatusException
? We will still need to handle it in ControllerAdvice...
@hizmailovich If we do inherit HttpStatusException
then we can remove Exception Handling inside ControllerAdvice
now we doing something like this:
and we do support exception handling via Spring Exception Handlers:
https://github.com/tracehubpm/pmo/blob/385414f0755d33204370b03d4078fc53170bd26a/src/main/java/git/tracehub/pmo/controller/AdviceController.java#L76-L87
We actually can get rid of this by making all our custom exceptions extend
HttpStatusException
. After this all of them will be handled by Spring@hizmailovich wdyt?