Package javax.time.calendar.format
Class CalendricalPrintException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
javax.time.CalendricalException
javax.time.calendar.format.CalendricalPrintException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CalendricalPrintFieldException
An exception thrown when an error occurs during printing.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
A serialization identifier for this class. -
Constructor Summary
ConstructorsConstructorDescriptionCalendricalPrintException
(String message) Constructs a new exception with the specified message.CalendricalPrintException
(String message, Throwable throwable) Constructs a new exception with the specified message and cause. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks if the cause of this exception was an IOException, and if so re-throws itMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDA serialization identifier for this class.- See Also:
-
-
Constructor Details
-
CalendricalPrintException
Constructs a new exception with the specified message.- Parameters:
message
- the message to use for this exception, may be null
-
CalendricalPrintException
Constructs a new exception with the specified message and cause.- Parameters:
message
- the message to use for this exception, may be nullthrowable
- the throwable to store as the cause, may be null
-
-
Method Details
-
rethrowIOException
Checks if the cause of this exception was an IOException, and if so re-throws itThis 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.- Throws:
IOException
- if the cause of this exception is an IOException
-