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
,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 codeprotected
PdfcException(com.inet.error.ErrorCode errorCode, java.lang.Throwable cause, java.lang.Object... params)
Creates the exception with error code and root causeprotected
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 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
create(java.lang.Throwable cause)
Creates a general exception from a cause.
-
-
-
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 setparams
- 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 setcause
- the causing exceptionparams
- 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 setparams
- 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 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
public static PdfcException create(@Nullable java.lang.Throwable cause)
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
-
-