It is very nice to have lots of different exceptions. Your code is declarative and robust. Or not? TL;DR: Don't create anemic and empty objects. Even if they are Exceptions. Problems Over Design Namespace Pollution Solutions Avoid creating...

Markdown supported · ⌘↵ to post
Yonatan Karp-Rudin
Senior Backend Software Engineer
Minor and unrelated to the focus of this post, but using
try-with-resourceswould have simplified the example a lot and made it much clearer what to look at.