-
Notifications
You must be signed in to change notification settings - Fork 3.1k
ControlThrowable never suppresses #7413
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
Conversation
|
For a more migration-friendly attempt at solving this problem, see #7165 Also, this fixes scala/bug#11116 |
|
@NthPortal thanks, obviously I didn't know you were already thinking about this. |
d10d082 to
6d6e024
Compare
|
Obviously, I'm being very lazy about this (because I'm using my repo for a different PR): non-fatal-tests.scala:19: error: class ControlThrowable is abstract; cannot be instantiated |
6d6e024 to
0cdd890
Compare
|
@NthPortal I tweaked the handling of |
fdc426b to
0bc0323
Compare
This comment has been minimized.
This comment has been minimized.
NthPortal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it doesn't break known uses, I would prefer extending Throwable
|
Just to note: the purpose of the PR was to exploit the newer constructor, but that sacrifices flexibility of the mix-in. It might be desirable to have both a non-Exception and an Exceptional version.
It's obvious from the Scaladoc that it was originally intended as a marker only, for all sorts of throwables, but maybe that intention was never fully realized. The clean-up adjusts the constructor and the Scaladoc. |
d698676 to
2805233
Compare
|
I think this is ready for merge once it's squashed? cc @SethTisue |
ControlThrowable never suppresses ControlThrowable stack trace can be writable Deprecate ControlThrowable with trace Assert order and message Test improvements ControlThrowable is not exceptional Since ControlThrowable is now more opinionated, just make it a Throwable, following the adage that Exceptions are for exceptional conditions. Update the doc to use NonFatal when catching, as the previous example contended with ControlThrowable mixed into arbitrary exceptions.
2805233 to
bd368a7
Compare
Make ControlThrowable a class with suppression and stack trace disabled.
This change would affect anyone mixing the trait into a custom Error or checked exception.