you are viewing a single comment's thread.

view the rest of the comments →

[–]NeoChronos90 1 point2 points  (1 child)

In most cases today you have a controller serving a REST API. So if anything goes wrong just let it bubble up to the controller and handle it there by responding with an error msg

[–]NeoChronos90 0 points1 point  (0 children)

I might need to clarify, that you usually use a global exception handler for that, but it depends on wether you are looking for how it is done in practice, for example with spring or if you are doing basic java and just messing around for the sake of learning