java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.joda.money.format.MoneyFormatException
- All Implemented Interfaces:
Serializable
Exception thrown during monetary formatting.
This exception makes no guarantees about immutability or thread-safety.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMoneyFormatException
(String message) Constructor taking a message.MoneyFormatException
(String message, Throwable cause) Constructor taking a 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
-
Constructor Details
-
MoneyFormatException
Constructor taking a message.- Parameters:
message
- the message
-
MoneyFormatException
Constructor taking a message and cause.- Parameters:
message
- the messagecause
- the exception cause
-
-
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, 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.- Throws:
IOException
- if the cause of this exception is an IOException
-