Package com.inet.pdfc.error
Class ExceptionData
- java.lang.Object
-
- com.inet.pdfc.error.ExceptionData
-
- All Implemented Interfaces:
com.inet.error.HasErrorCode
- Direct Known Subclasses:
PresenterExceptionData
@JsonData public class ExceptionData extends java.lang.Object implements com.inet.error.HasErrorCode
A JSON serializable replacement forThrowable
s. Since i-net PDFC is designed to persist and transmit any part of the result, consider to use this class in events instead of throwing anException
directly.- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description ExceptionData(int errorCode, java.lang.String errorClass, java.lang.String message, java.lang.String stack)
Creates an instance for aThrowable
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.lang.String
getErrorClass()
Returns the full class name of the root causeThrowable
int
getErrorCode()
Returns the error code or -1 if there originalThrowable
had nonejava.lang.String
getMessage()
Returns the message of the root causejava.lang.String
getStack()
Returns the stack trace of the root causeThrowable
java.lang.String
toString()
-
-
-
Constructor Detail
-
ExceptionData
public ExceptionData(int errorCode, java.lang.String errorClass, java.lang.String message, java.lang.String stack)
Creates an instance for aThrowable
- Parameters:
errorCode
- the error code if any, hence -1. ErrorCodes are well defined to the application and each plug-in so please don't guess this value. When in doubt, use -1.errorClass
- the full qualified class name of the original exception classmessage
- the message of the exceptionstack
- the stack of the exception- Since:
- 4.0
-
-
Method Detail
-
getErrorClass
public java.lang.String getErrorClass()
Returns the full class name of the root causeThrowable
- Returns:
- the full class name of the root cause
Throwable
, notnull
- Since:
- 4.0
-
getErrorCode
public int getErrorCode()
Returns the error code or -1 if there originalThrowable
had none- Specified by:
getErrorCode
in interfacecom.inet.error.HasErrorCode
- Returns:
- the error code or -1
- Since:
- 4.0
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getMessage
public java.lang.String getMessage()
Returns the message of the root cause- Returns:
- the message of the root cause, may be
null
e.g. for aNullPointerException
- Since:
- 4.0
-
getStack
public java.lang.String getStack()
Returns the stack trace of the root causeThrowable
- Returns:
- the stack trace of the root cause
Throwable
, may benull
if not provided by the root causeThrowable
- Since:
- 4.0
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-