-
-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch from AssertionError to IllegalStateException #264
Comments
Sounds reasonable. I'll change it, thanks for the suggestion. |
I'm having second thoughts about this. Assertion errors indicate the system has reached an unsupported and more importantly an unknown state and continuing could mean anything else the application does could be garbage. Essentially I cannot assume it is recoverable, in fact as a library designer I have to assume the opposite. It is an Error precisely so that the system halts. |
yes, i know the intention is to signal an impossibility to continue and from your point of view you can't know if the application will be able to recover, but maybe that's exactly why the choice should be left to the application. I think (but of course my perspective on this is limited to my use-case) that most people will end up catching the AssertionError like i did, in order to recover. Just to add context, imagine this sequence (from my use-case) https://docs.oracle.com/javase/7/docs/api/java/lang/Error.html Let me know what you think |
Released in 6.1.0 |
Is it possible to remove the AssertionErrors thrown by the Mailer, for example in case of empty MimeMessage body? I think it should be converted to an Exception. I understand what you are trying to do there, but as java applications normally don't catch Errors this leads applications to crash/fail for what it should really be a ValidationException (most likely recoverable, at least in my use-case).
The text was updated successfully, but these errors were encountered: