Class 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 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 Summary

      Constructors 
      Constructor Description
      ExceptionData​(int errorCode, java.lang.String errorClass, java.lang.String message, java.lang.String stack)
      Creates an instance for a Throwable
    • 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 cause Throwable
      int getErrorCode()
      Returns the error code or -1 if there original Throwable had none
      java.lang.String getMessage()
      Returns the message of the root cause
      java.lang.String getStack()
      Returns the stack trace of the root cause Throwable
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ExceptionData

        public ExceptionData​(int errorCode,
                             java.lang.String errorClass,
                             java.lang.String message,
                             java.lang.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 Detail

      • getErrorClass

        public java.lang.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 java.lang.String toString()
        Overrides:
        toString in class java.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 a NullPointerException
        Since:
        4.0
      • getStack

        public java.lang.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​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object