Closed
Description
Many Exception messages contain exclamation marks (!) at the end of the Exception message, for example:
"Object must not be null!"
While this alerts the user to an immediate problem in his/her code, it could be construed as abrasive.
Additionally, using any form of punctuation in Exception messages is not conducive for chaining. Generally, in Java Exception/Error (Throwable) chaining, the messages from the underlying Exceptions (causes) are chained together with the outer, wrapping Exception, for example:
java.lang.IllegalArgumentException: "Message from the wrapping IllegalArgumentException followed by; Message of the caused by Exception"
at ...
caused by: java.lang.IllegalStateException: Message of the caused by Exception
at ...
That is, the Exception messages from the chain are appended and separated by the ;
.
If the messages from the wrapping Exceptions in the Exception chain contain punctuation, then it can lead to confusing text:
java.lang.IllegalArgumentException: "Object must not be null!; Message of the caused by Exception"
at...
caused by: java.lang.IllegalStateException: Message of the caused by Exception
at ...