23 lines
448 B
Plaintext
23 lines
448 B
Plaintext
=== Noncompliant code example
|
|
|
|
[source,text]
|
|
----
|
|
try {
|
|
/* ... */
|
|
} catch (Exception e) { // Noncompliant - exception is lost
|
|
LOGGER.info("context");
|
|
}
|
|
|
|
try {
|
|
/* ... */
|
|
} catch (Exception e) { // Noncompliant - exception is lost (only message is preserved)
|
|
LOGGER.info(e.getMessage());
|
|
}
|
|
|
|
try {
|
|
/* ... */
|
|
} catch (Exception e) { // Noncompliant - original exception is lost
|
|
throw new RuntimeException("context");
|
|
}
|
|
----
|