Interface HasFriendlyErrorMessage

All Known Implementing Classes:
AnchorFriendlyCheckedException, AnchorFriendlyRuntimeException, AnchorImpossibleSituationException, AssignPermutationException, AxisConversionException, BeanDuplicateException, BeanMisconfiguredException, BeanStrangeException, BeanXMLException, BindFailedException, CheckedStream.ConvertedToRuntimeException, CommandLineException, CreateException, CSVReaderException, DefineAddException, DerivePathException, ExperimentExecutionException, FilesProviderException, FindFilesException, GetOperationFailedException, ImageIOException, ImageJConversionException, IncorrectImageSizeException, IncorrectVoxelTypeException, InitializeException, InvalidPathArgumentException, JobExecutionException, NamedFeatureCalculateException, OperationFailedException, OutputDirectoryAlreadyExistsException, OutputWriteFailedException, PathDifferenceException, PathPrefixerException, ProposalAbnormalFailureException, ProposerException, ProvisionFailedException, SegmentationFailedException, SuggestionFormatException, SummaryException

public interface HasFriendlyErrorMessage
Methods for extracting a user-friendly error description.
Author:
Owen Feehan
  • Method Summary

    Modifier and Type
    Method
    Description
    A 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 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
  • Method Details

    • friendlyMessage

      String friendlyMessage()
      A 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
      Returns:
      a string describing what went wrong
    • friendlyMessageHierarchy

      String friendlyMessageHierarchy()
      A friendly message to describe to the user what went wrong, which doesn't impose a fixed-size, or showExceptionNames
      Returns:
      a string (often multi-lined) describing a hierarchy of errors that occurred
    • friendlyMessageHierarchy

      void friendlyMessageHierarchy(Writer writer, int wordWrapLimit, boolean showExceptionNames) throws IOException
      A friendly message to describe to the user what went wrong, including all nested exceptions that have a non-empty error message

      It starts the least-most-nested exception. It ends with the further-most-nested exception (cause).

      Parameters:
      writer - where the friendly-messaged is outputted
      wordWrapLimit - 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