-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Increase suppression granularity in Using.resource #7457
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
| case _: InterruptedException | _: ThreadDeath => 2 | ||
| case _: ControlThrowable => 0 | ||
| case e if !NonFatal(e) => 1 // in case this method gets out of sync with NonFatal | ||
| case _ => -1 |
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.
Is there any chance to make this 4,3,2,1,0,-1 to be named constants?
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.
does that improve clarity? They're only used here, and I would think it's clearer when you can see their values (since they're not quite in sorted order)
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.
(because ControlThrowable sorts below other fatals, it needs to be matched before NonFatal, or they'll end up with the same score/rank)
58fc438 to
6129108
Compare
| case _: InterruptedException | _: ThreadDeath => 2 | ||
| case _: ControlThrowable => 0 | ||
| case e if !NonFatal(e) => 1 // in case this method gets out of sync with NonFatal | ||
| case _ => -1 |
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.
I am open to discussing whether this is in fact the best hierarchy
|
review @Ichoran |
7b49a2b to
639c4ab
Compare
639c4ab to
9763a18
Compare
Use granular hierarchy for exception suppression in `Using.resource`.
9763a18 to
f1ef66c
Compare
Use granular hierarchy for exception suppression in
Using.resource.The motivation for this PR is that it seemed odd to me that a
NonLocalReturnControlshould be thrown in preference to aVirtualMachineError.