public class CalendricalPrintException extends CalendricalException
Constructor and Description |
---|
CalendricalPrintException(java.lang.String message)
Constructs a new exception with the specified message.
|
CalendricalPrintException(java.lang.String message,
java.lang.Throwable throwable)
Constructs a new exception with the specified message and cause.
|
Modifier and Type | Method and Description |
---|---|
void |
rethrowIOException()
Checks if the cause of this exception was an IOException, and if so
re-throws it
|
public CalendricalPrintException(java.lang.String message)
message
- the message to use for this exception, may be nullpublic CalendricalPrintException(java.lang.String message, java.lang.Throwable throwable)
message
- the message to use for this exception, may be nullthrowable
- the throwable to store as the cause, may be nullpublic void rethrowIOException() throws java.io.IOException
This method is useful if you call a printer with an open stream or writer and want to ensure that IOExceptions are not lost.
try { printer.print(writer, dateTime); } catch (CalendricalFormatException ex) { ex.rethrowIOException(); // if code reaches here exception was caused by date-time issues }Note that calling this method will re-throw the original IOException, causing this CalendricalFormatException to be lost.
java.io.IOException
- if the cause of this exception is an IOException