Class PdfcException

  • All Implemented Interfaces:
    com.inet.error.HasErrorCode, java.io.Serializable

    public class PdfcException
    extends com.inet.error.BaseException
    Primary exception type to send exceptions with a numeric cause. This cause can be used to show additional help or info on a certain type of error
    Since:
    4.0
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected PdfcException​(com.inet.error.ErrorCode errorCode, java.lang.Object... params)
      Creates the exception with an error code
      protected PdfcException​(com.inet.error.ErrorCode errorCode, java.lang.Throwable cause, java.lang.Object... params)
      Creates the exception with error code and root cause
      protected PdfcException​(java.lang.Throwable cause)
      Creates a new general or wrapped exception from a cause.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static PdfcException create​(com.inet.error.ErrorCode errorCode, java.lang.Object... params)
      Creates the exception with an error code.
      static PdfcException create​(com.inet.error.ErrorCode errorCode, java.lang.Throwable cause, java.lang.Object... params)
      Creates the exception with error code and root cause.
      If cause is already a PdfcException then returns cause.
      Else if cause has an HasErrorCode, takes the code of cause instead of the given code.
      DOES NOT THROW THE EXCEPTION!
      static PdfcException create​(java.lang.Throwable cause)
      Creates a general exception from a cause.
      • Methods inherited from class com.inet.error.BaseException

        getErrorCode
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

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

      • PdfcException

        protected PdfcException​(@Nonnull
                                com.inet.error.ErrorCode errorCode,
                                @Nullable
                                java.lang.Object... params)
        Creates the exception with an error code
        Parameters:
        errorCode - the code to be set
        params - additional parameters to append to the error message
        Since:
        4.0
      • PdfcException

        protected PdfcException​(@Nonnull
                                com.inet.error.ErrorCode errorCode,
                                @Nullable
                                java.lang.Throwable cause,
                                @Nullable
                                java.lang.Object... params)
        Creates the exception with error code and root cause
        Parameters:
        errorCode - the code to be set
        cause - the causing exception
        params - additional parameters to append to the error message
        Since:
        4.0
      • PdfcException

        protected PdfcException​(@Nullable
                                java.lang.Throwable cause)
        Creates a new general or wrapped exception from a cause. If cause is instance of HasErrorCode then that error code and message is used. In the other case the default error code is used with a user friendly message from the cause as parameter.
        Parameters:
        cause - the causing exception, null is valid but discouraged
        Since:
        4.0
        See Also:
        create(Throwable)
    • Method Detail

      • create

        public static PdfcException create​(@Nonnull
                                           com.inet.error.ErrorCode errorCode,
                                           @Nullable
                                           java.lang.Object... params)
        Creates the exception with an error code. DOES NOT THROW THE EXCEPTION!
        Parameters:
        errorCode - the code to be set
        params - additional parameters to append to the error message
        Returns:
        a new Exception object
        Since:
        4.0
      • create

        public static PdfcException create​(@Nonnull
                                           com.inet.error.ErrorCode errorCode,
                                           @Nullable
                                           java.lang.Throwable cause,
                                           @Nullable
                                           java.lang.Object... params)
        Creates the exception with error code and root cause.
        If cause is already a PdfcException then returns cause.
        Else if cause has an HasErrorCode, takes the code of cause instead of the given code.
        DOES NOT THROW THE EXCEPTION!
        Parameters:
        errorCode - the code to be set
        cause - the causing exception
        params - additional parameters to append to the error message
        Returns:
        a new created exception or passed in cause if cause is an instance of PdfcException
        Since:
        4.0
      • create

        public static PdfcException create​(@Nullable
                                           java.lang.Throwable cause)
        Creates a general exception from a cause.
        If cause is already a PdfcException then returns cause.
        Else if cause has an HasErrorCode, then the code of cause is used.
        In the other case the default error code is used with a user friendly message from the cause as parameter.
        DOES NOT THROW THE EXCEPTION!
        Parameters:
        cause - the causing exception, null is valid but discouraged
        Returns:
        a new created exception or passed in cause if cause is an instance of PdfcException
        Since:
        4.0