Skip to content

Instantly share code, notes, and snippets.

@jarek-przygodzki
Created September 23, 2012 20:02
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/3772877 to your computer and use it in GitHub Desktop.
Save jarek-przygodzki/3772877 to your computer and use it in GitHub Desktop.
Base class for unchecked exceptions that does not fill in a stack trace of the current thread
/**
* Base class for unchecked exceptions that does not fill in a stack trace of
* the current thread
*/
@SuppressWarnings("serial")
public class RuntimeStacklessException extends RuntimeException {
public RuntimeStacklessException() {
super();
}
public RuntimeStacklessException(String message) {
super(message);
}
public RuntimeStacklessException(Throwable cause) {
super(cause);
}
public RuntimeStacklessException(String message, Throwable cause) {
super(message, cause);
}
/**
* Does not fill execution stack trace of the current thread
*
* @return a reference to this <code>Throwable</code> 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