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 Object implements com.inet.error.HasErrorCode
A JSON serializable replacement for Throwables. 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 an Exception directly.
Since:
4.0
  • Constructor Details

    • ExceptionData

      public ExceptionData(int errorCode, String errorClass, String message, String stack)
      Creates an instance for a Throwable
      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 class
      message - the message of the exception
      stack - the stack of the exception
      Since:
      4.0
  • Method Details

    • getErrorClass

      public String getErrorClass()
      Returns the full class name of the root cause Throwable
      Returns:
      the full class name of the root cause Throwable, not null
      Since:
      4.0
    • getErrorCode

      public int getErrorCode()
      Returns the error code or -1 if there original Throwable had none
      Specified by:
      getErrorCode in interface com.inet.error.HasErrorCode
      Returns:
      the error code or -1
      Since:
      4.0
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getMessage

      public String getMessage()
      Returns the message of the root cause
      Returns:
      the message of the root cause, may be null e.g. for a NullPointerException
      Since:
      4.0
    • getStack

      public String getStack()
      Returns the stack trace of the root cause Throwable
      Returns:
      the stack trace of the root cause Throwable, may be null if not provided by the root cause Throwable
      Since:
      4.0
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object