Class ExceptionConverter
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.gitlab.pdftk_java.com.lowagie.text.ExceptionConverter
- All Implemented Interfaces:
Serializable
The ExceptionConverter changes a checked exception into an
unchecked exception.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a RuntimeException based on another Exception -
Method Summary
Modifier and TypeMethodDescriptionrequests to fill in the stack trace we will have to ignore.and allow the user of ExceptionConverter to get a handle to it.and make sure we also produce a localized versionWe print the message of the checked exceptionvoid
we have to override this as wellvoid
here we prefix, with s.print(), not s.println(), the stack trace with "ExceptionConverter:"void
Again, we prefix the stack trace with "ExceptionConverter:"toString()
The toString() is changed to be prefixed with ExceptionConverterMethods inherited from class java.lang.Throwable
addSuppressed, getCause, getStackTrace, getSuppressed, initCause, setStackTrace
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDA serial version UID- See Also:
-
ex
we keep a handle to the wrapped exception -
prefix
prefix for the exception
-
-
Constructor Details
-
ExceptionConverter
Construct a RuntimeException based on another Exception- Parameters:
ex
- the exception that has to be turned into a RuntimeException
-
-
Method Details
-
getException
and allow the user of ExceptionConverter to get a handle to it.- Returns:
- the original exception
-
getMessage
We print the message of the checked exception- Overrides:
getMessage
in classThrowable
- Returns:
- message of the original exception
-
getLocalizedMessage
and make sure we also produce a localized version- Overrides:
getLocalizedMessage
in classThrowable
- Returns:
- localized version of the message
-
toString
The toString() is changed to be prefixed with ExceptionConverter -
printStackTrace
public void printStackTrace()we have to override this as well- Overrides:
printStackTrace
in classThrowable
-
printStackTrace
here we prefix, with s.print(), not s.println(), the stack trace with "ExceptionConverter:"- Overrides:
printStackTrace
in classThrowable
- Parameters:
s
-
-
printStackTrace
Again, we prefix the stack trace with "ExceptionConverter:"- Overrides:
printStackTrace
in classThrowable
- Parameters:
s
-
-
fillInStackTrace
requests to fill in the stack trace we will have to ignore. We can't throw an exception here, because this method is called by the constructor of Throwable- Overrides:
fillInStackTrace
in classThrowable
- Returns:
- a Throwable
-