Link Details

Link 4004 thumbnail
User 1 avatar

By rick
via wakao.wordpress.com
Published: Sep 28 2006 / 13:28

This is one of the most annoying error-handling antipatterns. Either log the exception, or throw it, but never do both.
  • 8
  • 0
  • 591
  • 492

Comments

Add your comment
User 179375 avatar

Ricky Clarkson replied ago:

0 votes Vote down Vote up Reply

Or pass it (or information about it) to the client code in the form of a callback (see my comment on the blog).

Or handle it in a way that is appropriate - there are other options besides logging and rethrowing exceptions, otherwise Java wouldn't have exceptions.

User 223844 avatar

abarnea_2000 replied ago:

0 votes Vote down Vote up Reply

Or use www.cajoon.com . . . completely transparent to the application, every exception causes the JVM to 'wake it up' and if type, class, method match criteria, extracts and records snapshot of heap and stack values at the precise moment of exception.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (8)



Voters Against This Link (0)