Package com.inet.pdfc.error
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 Summary
ModifierConstructorDescriptionprotected
PdfcException
(@Nonnull com.inet.error.ErrorCode errorCode, @Nullable Object... params) Creates the exception with an error codeprotected
PdfcException
(@Nonnull com.inet.error.ErrorCode errorCode, @Nullable Throwable cause, @Nullable Object... params) Creates the exception with error code and root causeprotected
PdfcException
(@Nullable Throwable cause) Creates a new general or wrapped exception from a cause. -
Method Summary
Modifier and TypeMethodDescriptionstatic PdfcException
Creates the exception with an error code.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 aPdfcException
then returns cause.
Else if cause has anHasErrorCode
, takes the code of cause instead of the given code.
DOES NOT THROW THE EXCEPTION!static PdfcException
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
-
Constructor Details
-
PdfcException
protected PdfcException(@Nonnull @Nonnull com.inet.error.ErrorCode errorCode, @Nullable @Nullable Object... params) Creates the exception with an error code- Parameters:
errorCode
- the code to be setparams
- additional parameters to append to the error message- Since:
- 4.0
-
PdfcException
protected PdfcException(@Nonnull @Nonnull com.inet.error.ErrorCode errorCode, @Nullable @Nullable Throwable cause, @Nullable @Nullable Object... params) Creates the exception with error code and root cause- Parameters:
errorCode
- the code to be setcause
- the causing exceptionparams
- additional parameters to append to the error message- Since:
- 4.0
-
PdfcException
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 @Nonnull com.inet.error.ErrorCode errorCode, @Nullable @Nullable Object... params) Creates the exception with an error code. DOES NOT THROW THE EXCEPTION!- Parameters:
errorCode
- the code to be setparams
- additional parameters to append to the error message- Returns:
- a new Exception object
- Since:
- 4.0
-
create
public static PdfcException create(@Nonnull @Nonnull com.inet.error.ErrorCode errorCode, @Nullable @Nullable Throwable cause, @Nullable @Nullable Object... params) Creates the exception with error code and root cause.
If cause is already aPdfcException
then returns cause.
Else if cause has anHasErrorCode
, takes the code of cause instead of the given code.
DOES NOT THROW THE EXCEPTION!- Parameters:
errorCode
- the code to be setcause
- the causing exceptionparams
- 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
Creates a general exception from a cause.
If cause is already aPdfcException
then returns cause.
Else if cause has anHasErrorCode
, 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
-