
org.sonar.l10n.squidjava.rules.squid.S00112.html Maven / Gradle / Ivy
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
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy