Skip to content

Instantly share code, notes, and snippets.

@oharsta
Created July 15, 2024 13:14
Show Gist options
  • Save oharsta/cfdbbe7933ead3547f9f4383f728e164 to your computer and use it in GitHub Desktop.
Save oharsta/cfdbbe7933ead3547f9f4383f728e164 to your computer and use it in GitHub Desktop.
Suppress stack-trace in BaseException
public class BaseException extends RuntimeException {
public BaseException(String message) {
super(message);
}
protected boolean suppressStackTrace() {
return false;
}
@Override
public synchronized Throwable fillInStackTrace() {
return this.suppressStackTrace() ? this : super.fillInStackTrace();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment