Package org.apache.ofbiz.base.util
Class GeneralException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.apache.ofbiz.base.util.GeneralException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
AuthenticatorException
,CartItemModifyException
,DataFileException
,EventHandlerException
,ExecutionServiceException
,GeneralServiceException
,GenericConfigException
,GenericEntityException
,GenericServiceException
,HttpClientException
,ItemNotFoundException
,JobManagerException
,MiniLangException
,RecurrenceInfoException
,RecurrenceRuleException
,RequestHandlerException
,RequestHandlerExceptionAllowExternalRequests
,ScreenRenderException
,SecurityConfigurationException
,SerializeException
,SurveyWrapper.SurveyWrapperException
,ViewHandlerException
,WebAppConfigurationException
,WebPosSession.UserLoginFailure
public class GeneralException extends java.lang.Exception
Base OFBiz Exception, provides nested exceptions, etc- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GeneralException()
Creates newGeneralException
without detail message.GeneralException(java.lang.String msg)
Constructs anGeneralException
with the specified detail message.GeneralException(java.lang.String msg, java.lang.Throwable nested)
Constructs anGeneralException
with the specified detail message and nested Exception.GeneralException(java.lang.String msg, java.util.List<java.lang.String> messages)
Constructs anGeneralException
with the specified detail message, list and nested Exception.GeneralException(java.lang.String msg, java.util.List<java.lang.String> messages, java.lang.Throwable nested)
Constructs anGeneralException
with the specified detail message, list and nested Exception.GeneralException(java.lang.Throwable nested)
Constructs anGeneralException
with the specified detail message and nested Exception.GeneralException(java.util.List<java.lang.String> messages)
GeneralException(java.util.List<java.lang.String> messages, java.lang.Throwable nested)
Constructs anGeneralException
with the specified detail message list and nested Exception.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> T
checkException(java.lang.String message, java.lang.Throwable t)
static <T> T
checkException(java.lang.Throwable t)
java.lang.String
getMessage()
Returns the detail message, including the message from the nested exception if there is one.java.util.List<java.lang.String>
getMessageList()
java.lang.Throwable
getNested()
Returns the nested exception if there is one, null if there is not.java.lang.String
getNonNestedMessage()
Returns the detail message, NOT including the message from the nested exception.void
printStackTrace()
Prints the composite message to System.err.void
printStackTrace(java.io.PrintStream ps)
Prints the composite message and the embedded stack trace to the specified stream ps.void
printStackTrace(java.io.PrintWriter pw)
Prints the composite message and the embedded stack trace to the specified print writer pw.
-
-
-
Constructor Detail
-
GeneralException
public GeneralException()
Creates newGeneralException
without detail message.
-
GeneralException
public GeneralException(java.lang.String msg)
Constructs anGeneralException
with the specified detail message.- Parameters:
msg
- the detail message.
-
GeneralException
public GeneralException(java.lang.String msg, java.lang.Throwable nested)
Constructs anGeneralException
with the specified detail message and nested Exception.- Parameters:
msg
- the detail message.nested
- the nested exception.
-
GeneralException
public GeneralException(java.lang.Throwable nested)
Constructs anGeneralException
with the specified detail message and nested Exception.- Parameters:
nested
- the nested exception.
-
GeneralException
public GeneralException(java.lang.String msg, java.util.List<java.lang.String> messages)
Constructs anGeneralException
with the specified detail message, list and nested Exception.- Parameters:
msg
- the detail message.messages
- error message list.
-
GeneralException
public GeneralException(java.lang.String msg, java.util.List<java.lang.String> messages, java.lang.Throwable nested)
Constructs anGeneralException
with the specified detail message, list and nested Exception.- Parameters:
msg
- the detail message.messages
- error message list.nested
- the nexted exception
-
GeneralException
public GeneralException(java.util.List<java.lang.String> messages, java.lang.Throwable nested)
Constructs anGeneralException
with the specified detail message list and nested Exception.- Parameters:
messages
- error message list.nested
- the nested exception.
-
GeneralException
public GeneralException(java.util.List<java.lang.String> messages)
-
-
Method Detail
-
checkException
public static <T> T checkException(java.lang.Throwable t) throws GeneralException
- Throws:
GeneralException
-
checkException
public static <T> T checkException(java.lang.String message, java.lang.Throwable t) throws GeneralException
- Throws:
GeneralException
-
getMessage
public java.lang.String getMessage()
Returns the detail message, including the message from the nested exception if there is one.- Overrides:
getMessage
in classjava.lang.Throwable
-
getMessageList
public java.util.List<java.lang.String> getMessageList()
-
getNonNestedMessage
public java.lang.String getNonNestedMessage()
Returns the detail message, NOT including the message from the nested exception.
-
getNested
public java.lang.Throwable getNested()
Returns the nested exception if there is one, null if there is not.
-
printStackTrace
public void printStackTrace()
Prints the composite message to System.err.- Overrides:
printStackTrace
in classjava.lang.Throwable
-
printStackTrace
public void printStackTrace(java.io.PrintStream ps)
Prints the composite message and the embedded stack trace to the specified stream ps.- Overrides:
printStackTrace
in classjava.lang.Throwable
-
printStackTrace
public void printStackTrace(java.io.PrintWriter pw)
Prints the composite message and the embedded stack trace to the specified print writer pw.- Overrides:
printStackTrace
in classjava.lang.Throwable
-
-