public class AnchorFriendlyRuntimeException extends AnchorRuntimeException implements HasFriendlyErrorMessage
See the counterpart AnchorFriendlyCheckedException
.
Constructor and Description |
---|
AnchorFriendlyRuntimeException(String message)
A user-friendly error message without a cause.
|
AnchorFriendlyRuntimeException(String message,
Throwable cause)
A user-friendly error message and its cause.
|
AnchorFriendlyRuntimeException(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
|
toString
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
public AnchorFriendlyRuntimeException(String message, Throwable cause)
message
- a user-friendly error message to display to the user indicating the problem.cause
- the cause of the error.public AnchorFriendlyRuntimeException(String message)
message
- cause the cause of the error.public AnchorFriendlyRuntimeException(Throwable cause)
cause
- the cause of the error.public 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 writerCopyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.