Skip to content

Instantly share code, notes, and snippets.

@jarek-przygodzki
Created September 23, 2012 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jarek-przygodzki/3772881 to your computer and use it in GitHub Desktop.
Save jarek-przygodzki/3772881 to your computer and use it in GitHub Desktop.
Base class for checked exceptions that does not fill in a stack trace of the current thread.
/**
* Base class for checked exceptions that does not fill in a stack trace of the
* current thread.
*/
@SuppressWarnings("serial")
public class StacklessException extends Exception {
public StacklessException() {
super();
}
public StacklessException(String message) {
super(message);
}
public StacklessException(Throwable cause) {
super(cause);
}
public StacklessException(String message, Throwable cause) {
super(message, cause);
}
/**
* Does not fill execution stack trace of the current thread
*
* @return a reference to this {@code Throwable} instance.
* @see java.lang.Throwable#printStackTrace()
*/
@Override
public Throwable fillInStackTrace() {
return this;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment