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
AssertionError should be considered fatal #10166
Comments
Imported From: https://issues.scala-lang.org/browse/SI-10166?orig=1 |
@som-snytt said: |
Jasper-M said: |
As I commented on the PR, I think |
PR: scala/scala#6320 |
Is there enough information to be able to say that "all" AssertionErrors are fatal? |
@viktorklang tbh I don't really understand why any |
is there a canonical example (or two or three) of an |
for |
most of the discussion for this seems to have happened at scala/scala#6320 (don't know why) |
@SethTisue «An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch. » - https://docs.oracle.com/javase/8/docs/api/java/lang/Error.html The problem is that there are quite a few unreasonable applications out there, and since Error is extendable it is impossible to say that all Errors are fatal. ThreadDeath, for instance, is a NonFatal Error. |
to be fair, |
@NthPortal To be fair, I only checked JavaSE ;) |
It's a datapoint a bit far fetched, but IntelliJ shows @Ichoran sorry to nit-pick, but it's In my understanding, the errors that are excluded in |
@lrytz I think that's just because ... which is another reason it should stay non-fatal, as a good testing harness shouldn't catch fatals (although it could specifically go out of its way to catch |
looks like this is not-a-bug/wontfix perhaps there's room for a new PR that improves the Scaladoc for |
quoth @Ichoran on Gitter:
|
AssertionError
s, being outside the list of fatal errors defined forNonFatal
, are caught by code matching onNonFatal
and with theTry
construct - making it easy for failed assertions to be inappropriately handled or silently discarded where they should be considered fatal application failures and fail loudly to inform the developer/tester that a program assumption/assertion has been broken and requires remediation.The text was updated successfully, but these errors were encountered: