DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 964,423 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in

Discussion on: Ignoring Exceptions in Java

Collapse
 
florianschaetz profile image
(((Florian SchΓ€tz)))

Especially for database exceptions, I suggest also having a look at Spring's version: It uses explicit converters to convert the SQLExceptions into a hierarchy of RuntimeExceptions, where the root is DataAccessException. This allows for completely optional and much more meaningfull exception handling (for example, an opertions that threw a TransientDataAcessException can simply be re-tried, while one that threw a NonTransientDataAccessException like BadSqlGrammarException would not get better by re-trying).