Class PdfcException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.inet.error.BaseException
com.inet.pdfc.error.PdfcException
All Implemented Interfaces:
com.inet.error.HasErrorCode, 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:
  • Constructor Details

    • PdfcException

      protected PdfcException(@Nonnull com.inet.error.ErrorCode errorCode, @Nullable 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 Throwable cause, @Nullable 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 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:
  • Method Details

    • create

      public static PdfcException create(@Nonnull com.inet.error.ErrorCode errorCode, @Nullable 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 Throwable cause, @Nullable 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 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