Package church.i18n.processing.exception
Class ProcessingException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
church.i18n.processing.exception.ProcessingException
- All Implemented Interfaces:
ProcessingExceptionIntermediate<ProcessingException>,ProcessingInfo,ProcessingStatus,ProcessingLogLevel,ProcessingMessageBuilderMethods<ProcessingException>,Serializable
public class ProcessingException
extends RuntimeException
implements ProcessingInfo, ProcessingExceptionIntermediate<ProcessingException>
Generic exception with enough information but not more for handling exceptional state in the
application. It holds information user may need to know what has happened, how to deal with the
problem or where to look for a solution.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionProcessingException(@NotNull ProcessingMessage message) Constructor with specified message.ProcessingException(@NotNull ProcessingMessage message, @Nullable Throwable cause) Constructor with a message and concrete cause of this exception.ProcessingException(@NotNull String code, @Nullable Object... params) Constructor with base code and message parameters. -
Method Summary
Modifier and TypeMethodDescription@NotNull ProcessingExceptionaddContextInfo(@Nullable ContextInfo... contextInfo) Add contextual information to the message.@NotNull ProcessingExceptionaddContextInfo(@Nullable List<ContextInfo> contextInfo) Add additional contextual information bounded to message.boolean@NotNull LogLevelSpecification of a logging level of an error.@NotNull ProcessingMessage@NotNull StatusThe value describes wider status of processing and can be used for inter-system communication.inthashCode()@NotNull StringtoString()@NotNull ProcessingExceptionwithHelpUri(@NotNull String helpUri) Help URI associated with this message that may help receiver to find more information about the problem, better understand it and resolve it quickly.@NotNull ProcessingExceptionwithHelpUri(@Nullable URI helpUri) Help URI associated with this message that may help receiver to find more information about the problem, better understand it and resolve it quickly.@NotNull ProcessingExceptionwithLogLevel(@NotNull LogLevel logLevel) Specify log level of exception.@NotNull ProcessingExceptionwithMessageType(@NotNull MessageType messageType) Type of message, such as severity or message status.@NotNull ProcessingExceptionwithSecurityLevel(@Nullable SecurityLevel securityLevel) Specify security level of information in message.@NotNull ProcessingExceptionwithStatus(@NotNull Status status) Specify the response status of an exception that can be used for system inter-communication.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
ProcessingException
Constructor with base code and message parameters.- Parameters:
code- Thecodethat may reference message in localization property file. When no such localized message withcodehas been found, the code itself is used as message.params- list of parameters needed for construction of localized message. If the last parameter isThrowable, it is used as cause of this exception.
-
ProcessingException
Constructor with specified message.- Parameters:
message- Error message of the exception.
-
ProcessingException
public ProcessingException(@NotNull @NotNull ProcessingMessage message, @Nullable @Nullable Throwable cause) Constructor with a message and concrete cause of this exception.- Parameters:
message- A message of the exception.cause- The throwable that caused thisProcessingExceptionto get thrown.
-
-
Method Details
-
addContextInfo
@NotNull public @NotNull ProcessingException addContextInfo(@Nullable @Nullable List<ContextInfo> contextInfo) Description copied from interface:ProcessingMessageBuilderMethodsAdd additional contextual information bounded to message. It appends this contextual information to all previously added contextual information.- Specified by:
addContextInfoin interfaceProcessingMessageBuilderMethods<ProcessingException>- Parameters:
contextInfo- Contextual information you want to provide together with the message.- Returns:
- An instance of an
ProcessingMessageBuilderMethodswith appended contextual information.
-
addContextInfo
@NotNull public @NotNull ProcessingException addContextInfo(@Nullable @Nullable ContextInfo... contextInfo) Description copied from interface:ProcessingMessageBuilderMethodsAdd contextual information to the message.- Specified by:
addContextInfoin interfaceProcessingMessageBuilderMethods<ProcessingException>- Parameters:
contextInfo- Additional contextual information appended to message.- Returns:
- An instance of an
ProcessingMessageBuilderMethodswith appended contextual information.
-
withHelpUri
Description copied from interface:ProcessingMessageBuilderMethodsHelp URI associated with this message that may help receiver to find more information about the problem, better understand it and resolve it quickly. It can be reference to the documentation, KB or other article describing problem.- Specified by:
withHelpUriin interfaceProcessingMessageBuilderMethods<ProcessingException>- Parameters:
helpUri- Resource identifier.- Returns:
- An instance of an
ProcessingMessageBuilderMethodswith appended contextual information.
-
withHelpUri
Description copied from interface:ProcessingMessageBuilderMethodsHelp URI associated with this message that may help receiver to find more information about the problem, better understand it and resolve it quickly. It can be reference to the documentation, KB or other article describing problem.- Specified by:
withHelpUriin interfaceProcessingMessageBuilderMethods<ProcessingException>- Parameters:
helpUri- Resource identifier.- Returns:
- An instance of an
ProcessingMessageBuilderMethodswith appended contextual information.
-
withSecurityLevel
@NotNull public @NotNull ProcessingException withSecurityLevel(@Nullable @Nullable SecurityLevel securityLevel) Description copied from interface:ProcessingMessageBuilderMethodsSpecify security level of information in message.- Specified by:
withSecurityLevelin interfaceProcessingMessageBuilderMethods<ProcessingException>- Parameters:
securityLevel- Security level of information in message.- Returns:
- An instance of an
ProcessingMessageBuilderMethodswith appended contextual information.
-
withMessageType
@NotNull public @NotNull ProcessingException withMessageType(@NotNull @NotNull MessageType messageType) Description copied from interface:ProcessingMessageBuilderMethodsType of message, such as severity or message status. For more information seeMessageStatusorMessageSeverity.- Specified by:
withMessageTypein interfaceProcessingMessageBuilderMethods<ProcessingException>- Parameters:
messageType- The type of this message.- Returns:
- An instance of an
ProcessingMessageBuilderMethodswith appended contextual information.
-
getLogLevel
Description copied from interface:ProcessingLogLevelSpecification of a logging level of an error.- Specified by:
getLogLevelin interfaceProcessingLogLevel- Returns:
- Log level of exception.
-
getProcessingMessage
- Specified by:
getProcessingMessagein interfaceProcessingInfo
-
getStatus
Description copied from interface:ProcessingStatusThe value describes wider status of processing and can be used for inter-system communication. The typical example usage can be similar to widely known HTTP response status.- Specified by:
getStatusin interfaceProcessingStatus- Returns:
- Status associated with the exception.
-
withLogLevel
Description copied from interface:ProcessingExceptionIntermediateSpecify log level of exception.- Specified by:
withLogLevelin interfaceProcessingExceptionIntermediate<ProcessingException>- Parameters:
logLevel- The log level you want to use.- Returns:
- An instance of object
ProcessingExceptionIntermediate.
-
withStatus
Description copied from interface:ProcessingExceptionIntermediateSpecify the response status of an exception that can be used for system inter-communication.- Specified by:
withStatusin interfaceProcessingExceptionIntermediate<ProcessingException>- Parameters:
status- Status associated with this exception.- Returns:
- An instance of object
ProcessingExceptionIntermediate.
-
hashCode
public int hashCode() -
equals
-
toString
-