I find it odd how most examples fully encourage throwing NotFoundExceptions or ValidationExceptions throughout rest apis to be handled by some magic exception handler elsewhere in the code.
It's essentially using exceptions for control flow which is generally not tolerated anywhere else in code bases but is blatantly abused in JAX-RS and Spring.
I would much prefer sending different responses since I know if its found or not or valid or not. It would be very explicit in the code what is happening when and why. It's very simple to do this in all of the frameworks but I rarely see it done. Any arguments for why people use ExceptionMappers for so many things?
Bill O'Neil
Some discussion here reddit.com/r/java/comments/6vthg9/guide_to_spring…