Class MException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.io7m.montarre.api.MException
All Implemented Interfaces:
com.io7m.seltzer.api.SStructuredErrorExceptionType<String>, com.io7m.seltzer.api.SStructuredErrorType<String>, Serializable

public class MException extends Exception implements com.io7m.seltzer.api.SStructuredErrorExceptionType<String>
The type of exceptions raised by the package.
See Also:
  • Constructor Details

    • MException

      public MException(Throwable cause, String inErrorCode, Map<String,String> inAttributes, Optional<String> inRemediatingAction)
      Construct an exception.
      Parameters:
      cause - The cause
      inErrorCode - The error code
      inAttributes - The attributes
      inRemediatingAction - The remediating action
    • MException

      public MException(String message, String inErrorCode, Map<String,String> inAttributes, Optional<String> inRemediatingAction)
      Construct an exception.
      Parameters:
      message - The message
      inErrorCode - The error code
      inAttributes - The attributes
      inRemediatingAction - The remediating action
    • MException

      public MException(String message, Throwable cause, String inErrorCode, Map<String,String> inAttributes, Optional<String> inRemediatingAction)
      Construct an exception.
      Parameters:
      message - The message
      cause - The cause
      inErrorCode - The error code
      inAttributes - The attributes
      inRemediatingAction - The remediating action
    • MException

      public MException(String message, Throwable cause, String inErrorCode)
      Construct an exception.
      Parameters:
      message - The message
      cause - The cause
      inErrorCode - The error code
    • MException

      public MException(String message, Throwable cause, String inErrorCode, Map<String,String> inAttributes)
      Construct an exception.
      Parameters:
      message - The message
      cause - The cause
      inErrorCode - The error code
      inAttributes - The attributes
    • MException

      public MException(String message, Throwable cause, String inErrorCode, Optional<String> inRemediatingAction)
      Construct an exception.
      Parameters:
      message - The message
      cause - The cause
      inErrorCode - The error code
      inRemediatingAction - The remediating action
    • MException

      public MException(Throwable cause, String inErrorCode, Optional<String> inRemediatingAction)
      Construct an exception.
      Parameters:
      cause - The cause
      inErrorCode - The error code
      inRemediatingAction - The remediating action
    • MException

      public MException(String message, String inErrorCode, Optional<String> inRemediatingAction)
      Construct an exception.
      Parameters:
      message - The message
      inErrorCode - The error code
      inRemediatingAction - The remediating action
    • MException

      public MException(String message, String inErrorCode, Map<String,String> inAttributes)
      Construct an exception.
      Parameters:
      message - The message
      inErrorCode - The error code
      inAttributes - The attributes
  • Method Details

    • wrap

      public static MException wrap(Throwable e)
      Wrap an exception.
      Parameters:
      e - The exception
      Returns:
      The wrapped exception
    • errorCode

      public final String errorCode()
      Specified by:
      errorCode in interface com.io7m.seltzer.api.SStructuredErrorType<String>
    • attributes

      public final Map<String,String> attributes()
      Specified by:
      attributes in interface com.io7m.seltzer.api.SStructuredErrorType<String>
    • remediatingAction

      public final Optional<String> remediatingAction()
      Specified by:
      remediatingAction in interface com.io7m.seltzer.api.SStructuredErrorType<String>
    • exception

      public final Optional<Throwable> exception()
      Specified by:
      exception in interface com.io7m.seltzer.api.SStructuredErrorType<String>