All Downloads are FREE. Search and download functionalities are using the official Maven repository.

errorprone.bugpattern.CatchAndPrintStackTrace.md Maven / Gradle / Ivy

The newest version!
Discarding an exception after calling `printStackTrace` should usually be
avoided.

```java
try {
  // ...
} catch (IOException e) {
  logger.log(INFO, "something has gone terribly wrong", e);
}
```

```java
try {
  // ...
} catch (IOException e) {
  throw new UncheckedIOException(e); // New in Java 8
}
```

```java
try {
  // ...
} catch (IOException e) {
  e.printStackTrace();
}
```




© 2015 - 2025 Weber Informatics LLC | Privacy Policy