java.io.Serializablepublic class MoneyFormatException
extends java.lang.RuntimeException
This exception makes no guarantees about immutability or thread-safety.
| Constructor | Description |
|---|---|
MoneyFormatException(java.lang.String message) |
Constructor taking a message.
|
MoneyFormatException(java.lang.String message,
java.lang.Throwable cause) |
Constructor taking a message and cause.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
rethrowIOException() |
Checks if the cause of this exception was an IOException, and if so re-throws it
|
public MoneyFormatException(java.lang.String message)
message - the messagepublic MoneyFormatException(java.lang.String message,
java.lang.Throwable cause)
message - the messagecause - the exception causepublic 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, money);
} catch (CalendricalFormatException ex) {
ex.rethrowIOException();
// if code reaches here exception was caused by issues other than IO
}
Note that calling this method will re-throw the original IOException,
causing this MoneyFormatException to be lost.java.io.IOException - if the cause of this exception is an IOExceptionCopyright © 2009–2018 Joda.org. All rights reserved.