cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Cassandra Wiki] Update of "CodeStyle" by JonathanEllis
Date Wed, 12 Aug 2009 20:43:10 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Cassandra Wiki" for change notification.

The following page has been changed by JonathanEllis:
http://wiki.apache.org/cassandra/CodeStyle

------------------------------------------------------------------------------
  
  == Exception handling ==
  
-  * Never ever write `catch (...) {}` or `catch (...) { logger.error() }` merely to satisfy
Java's compile-time exception checking.  Always propagate the exception up or throw RuntimeException.
 This makes the exceptions visible to automated tests.
+  * Never ever write `catch (...) {}` or `catch (...) { logger.error() }` merely to satisfy
Java's compile-time exception checking.  Always propagate the exception up or throw RuntimeException
(or, if it "can't happen," AssertionError).  This makes the exceptions visible to automated
tests.
   * Similarly, `logger.warn()` is often a cop-out: is this an error or not?  If it is don't
hide it behind a warn; if it isn't, no need for the warning.
   * If you genuinely know an exception indicates an expected condition, it's okay to ignore
it BUT this must be explicitly explained in a comment.
  

Mime
View raw message