Is there a way to make eclipse report a general "catch (Exception e)" as an error/warning (in java)?

Posted by Rog on Stack Overflow See other posts from Stack Overflow or by Rog
Published on 2010-04-19T08:18:43Z Indexed on 2010/04/19 8:23 UTC
Read the original article Hit count: 208

Filed under:
|
|
|

I'm trying to encourage a best practice of not catching general exceptions in Java code. eg:

try {
  ...
} catch (Exception e) {  // bad!
  ...
}

Is there a way to flag this as an error/warning in Eclipse?

I know PMD picks this up, but I'd rather avoid integrating it into everyone's build environment at the moment.

© Stack Overflow or respective owner

Related posts about java

Related posts about exception