Class AnchorFriendlyCheckedException
Object
Throwable
Exception
AnchorCheckedException
AnchorFriendlyCheckedException
- All Implemented Interfaces:
Serializable,HasFriendlyErrorMessage
- Direct Known Subclasses:
AssignPermutationException,AxisConversionException,BeanMisconfiguredException,BeanXMLException,BindFailedException,CreateException,CSVReaderException,DefineAddException,DerivePathException,ExperimentExecutionException,FilesProviderException,FindFilesException,GetOperationFailedException,ImageIOException,ImageJConversionException,IncorrectImageSizeException,InitializeException,InvalidPathArgumentException,JobExecutionException,NamedFeatureCalculateException,OperationFailedException,OutputWriteFailedException,PathDifferenceException,PathPrefixerException,ProposalAbnormalFailureException,ProposerException,ProvisionFailedException,SegmentationFailedException,SuggestionFormatException,SummaryException
public abstract class AnchorFriendlyCheckedException
extends AnchorCheckedException
implements HasFriendlyErrorMessage
A base class for particular checked-exceptions which are guaranteed to provide a user-friendly
error description.
See the counterpart AnchorFriendlyRuntimeException.
- Author:
- Owen Feehan
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAnchorFriendlyCheckedException(String message) A user-friendly error message WITHOUT a cause.protectedAnchorFriendlyCheckedException(String message, Throwable cause) A user-friendly error message and its cause.protectedA wrapped exception. -
Method Summary
Modifier and TypeMethodDescriptionA friendly message to describe to the user what went wrong.A friendly message to describe to the user what went wrong, which doesn't impose a fixed-size, or showExceptionNamesvoidfriendlyMessageHierarchy(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 messagePrints a stack trace of the current exception to a string.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
AnchorFriendlyCheckedException
A user-friendly error message and its cause. The message is displayed to the user.- Parameters:
message- a user-friendly error message to display to the user indicating the problem.cause- the cause of the error.
-
AnchorFriendlyCheckedException
A user-friendly error message WITHOUT a cause. This exception is displayed to the user. There are no more nested-errors possible.- Parameters:
message- a message describing the error.
-
AnchorFriendlyCheckedException
A wrapped exception. We skip it in error reports- Parameters:
cause- the cause of the error
-
-
Method Details
-
friendlyMessage
Description copied from interface:HasFriendlyErrorMessageA friendly message to describe to the user what went wrong. If no message has been defined in this exception, we keep iterating the hierarchy until we find a message- Specified by:
friendlyMessagein interfaceHasFriendlyErrorMessage- Returns:
- a string describing what went wrong
-
friendlyMessageHierarchy
Description copied from interface:HasFriendlyErrorMessageA friendly message to describe to the user what went wrong, which doesn't impose a fixed-size, or showExceptionNames- Specified by:
friendlyMessageHierarchyin interfaceHasFriendlyErrorMessage- Returns:
- a string (often multi-lined) describing a hierarchy of errors that occurred
-
friendlyMessageHierarchy
public void friendlyMessageHierarchy(Writer writer, int wordWrapLimit, boolean showExceptionNames) throws IOException Description copied from interface:HasFriendlyErrorMessageA friendly message to describe to the user what went wrong, including all nested exceptions that have a non-empty error messageIt starts the least-most-nested exception. It ends with the further-most-nested exception (cause).
- Specified by:
friendlyMessageHierarchyin interfaceHasFriendlyErrorMessage- Parameters:
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 output- Throws:
IOException- if an I/O error occurs with the writer
-
stackTrace
Prints a stack trace of the current exception to a string.- Returns:
- a string describing the stack trace of the exception.
-