Class QException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.io7m.quarrel.core.QException
- All Implemented Interfaces:
com.io7m.seltzer.api.SStructuredErrorExceptionType<String>, com.io7m.seltzer.api.SStructuredErrorType<String>, Serializable
-
Constructor Summary
ConstructorsConstructorDescriptionQException(String message, String inErrorCode, Map<String, String> inAttributes, Optional<String> inRemediatingAction, List<com.io7m.seltzer.api.SStructuredErrorType<String>> inExtraErrors) Construct an exception.QException(String message, Throwable cause, String inErrorCode, Map<String, String> inAttributes, Optional<String> inRemediatingAction, List<com.io7m.seltzer.api.SStructuredErrorType<String>> inExtraErrors) Construct an exception. -
Method Summary
Modifier and TypeMethodDescriptionstatic <C, T extends Exception & com.io7m.seltzer.api.SStructuredErrorExceptionType<C>>
QExceptionAdapt a generic exception to this exception type.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.io7m.seltzer.api.SStructuredErrorExceptionType
getMessage, message
-
Constructor Details
-
QException
public QException(String message, String inErrorCode, Map<String, String> inAttributes, Optional<String> inRemediatingAction, List<com.io7m.seltzer.api.SStructuredErrorType<String>> inExtraErrors) Construct an exception.- Parameters:
message- The messageinErrorCode- The error codeinAttributes- The error attributesinRemediatingAction- The remediating action, if anyinExtraErrors- The extra errors, if any
-
QException
public QException(String message, Throwable cause, String inErrorCode, Map<String, String> inAttributes, Optional<String> inRemediatingAction, List<com.io7m.seltzer.api.SStructuredErrorType<String>> inExtraErrors) Construct an exception.- Parameters:
message- The messagecause- The causeinErrorCode- The error codeinAttributes- The error attributesinRemediatingAction- The remediating action, if anyinExtraErrors- The extra errors, if any
-
-
Method Details
-
adapt
public static <C, T extends Exception & com.io7m.seltzer.api.SStructuredErrorExceptionType<C>> QException adapt(T exception, Function<C, String> errorCodeConverter) Adapt a generic exception to this exception type.- Type Parameters:
C- The type of error codesT- The type of base exceptions- Parameters:
exception- An exceptionerrorCodeConverter- A converter from error codes to strings- Returns:
- An exception
-
extraErrors
-
errorCode
-
attributes
-
remediatingAction
-
exception
-