/gist:3222ebf53ecb3febbb07 Secret
Last active
August 29, 2015 14:07
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source https://dev.eclipse.org/sonar/rules/show/squid:S00112 | |
// Using such generic exception prevents calling methods from | |
// handling differently each kind of error. | |
// The following code snippet illustrates this rule: | |
public void foo(String bar) throws Throwable { // Non-Compliant | |
throw new RuntimeException("My Message"); // Non-Compliant | |
} | |
public void foo(String bar) { | |
throw new MyRuntimeException("My Message"); // Compliant | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment