On the cutting edge of exception handling

1 · Ivan Ivanchuk · Aug. 6, 2023, midnight
On the cutting edge of exception handling Ivan Ivanchuck Unfortunately, in work we’re use Spring Framework. Not too long ago I was able to discover an interesting detail in our approach to exception handling. Usually it looks like some class (most often a service) throws an exception. There is an exception handler in another part of the program that does the job. // class that throws public class DrinkService { public drinkAndDoThings() { throw new HangoverException("You have a headache!") } ...