public abstract class AnchorFriendlyCheckedException extends AnchorCheckedException implements HasFriendlyErrorMessage
See the counterpart AnchorFriendlyRuntimeException
.
Modifier | Constructor and Description |
---|---|
protected |
AnchorFriendlyCheckedException(String message)
A user-friendly error message WITHOUT a cause.
|
protected |
AnchorFriendlyCheckedException(String message,
Throwable cause)
A user-friendly error message and its cause.
|
protected |
AnchorFriendlyCheckedException(Throwable cause)
A wrapped exception.
|
Modifier and Type | Method and Description |
---|---|
String |
friendlyMessage()
A friendly message to describe to the user what went wrong.
|
String |
friendlyMessageHierarchy()
A friendly message to describe to the user what went wrong, which doesn't impose a
fixed-size, or showExceptionNames
|
void |
friendlyMessageHierarchy(Writer writer,
int wordWrapLimit,
boolean showExceptionNames)
A friendly message to describe to the user what went wrong, including all nested exceptions
that have a non-empty error message
|
String |
stackTrace()
Prints a stack trace of the current exception to a string.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
protected AnchorFriendlyCheckedException(String message, Throwable cause)
message
- a user-friendly error message to display to the user indicating the problem.cause
- the cause of the error.protected AnchorFriendlyCheckedException(String message)
message
- a message describing the error.protected AnchorFriendlyCheckedException(Throwable cause)
cause
- the cause of the errorpublic String friendlyMessage()
HasFriendlyErrorMessage
friendlyMessage
in interface HasFriendlyErrorMessage
public String friendlyMessageHierarchy()
HasFriendlyErrorMessage
friendlyMessageHierarchy
in interface HasFriendlyErrorMessage
public void friendlyMessageHierarchy(Writer writer, int wordWrapLimit, boolean showExceptionNames) throws IOException
HasFriendlyErrorMessage
It starts the least-most-nested exception. It ends with the further-most-nested exception (cause).
friendlyMessageHierarchy
in interface HasFriendlyErrorMessage
writer
- where the friendly-messaged is outputtedwordWrapLimit
- a fixed-width size for the message and indentation (ignoring the
exception name). -1 disables.showExceptionNames
- show exception-names after the error outputIOException
- if an I/O error occurs with the writerpublic String stackTrace()
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.