Package com.storedobject.common
Class SOException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.storedobject.common.SOException
- All Implemented Interfaces:
EndUserMessage,Serializable
- Direct Known Subclasses:
SOException
Represents a custom exception that integrates with the
EndUserMessage interface
to provide user-friendly error messages, while also supporting detailed technical
error descriptions for debugging purposes.
This exception extends Exception and implements EndUserMessage,
enabling it to generate both high-level, end-user-oriented messages and low-level,
developer-oriented diagnostic messages.
- Customizable messages retrievable via theThegetMessage()andgetEndUserMessage()methods. - Automatically includes the messages and stack traces of any nested causes in the output. - Facilitates enhanced string formatting for exception details.
getEndUserMessage() method aims to return concise, user-friendly messages,
while the getMessage() method provides a comprehensive description, including
nested causes for diagnostic purposes.- Author:
- Syam
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for the SOException class.SOException(String message) Constructs a new SOException with the specified detail message.SOException(String message, Throwable cause) Constructs a new SOException with the specified detail message and cause. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
SOException
public SOException()Default constructor for the SOException class. Creates a new instance of SOException without any specific message or cause. -
SOException
Constructs a new SOException with the specified detail message.- Parameters:
message- The detail message that describes the reason for the exception.
-
SOException
Constructs a new SOException with the specified detail message and cause.- Parameters:
message- The detail message that explains the reason for the exception.cause- The underlying cause of the exception, which can be used to provide additional context.
-
-
Method Details
-
getEndUserMessage
Description copied from interface:EndUserMessageGet the message.- Specified by:
getEndUserMessagein interfaceEndUserMessage- Returns:
- The message that is for the end-users to read.
-
getMessage
- Overrides:
getMessagein classThrowable
-
getCustomMessage
Retrieves a custom message associated with the exception.- Returns:
- A string representing the custom message, or null if no custom message is set.
-
toString
-
getRootMessage
Retrieves the root message associated with the exception. The root message provides the base-level explanation for why the exception was thrown.- Returns:
- A string representing the root message, or null if no base message is available.
-