-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Non-slingshot exceptions with slingshot causes are being ignored in try+/catch block #52
Comments
@aboytsov -- this issue comes up a lot, but Slingshot does not match on Exception e. Or at least, it didn't for a long time. For those circumstances where you want Slingshot to catch everything, you match on Object:
|
rbrw
added a commit
to rbrw/trapperkeeper
that referenced
this issue
Feb 25, 2020
While we're reworking this code, remove slingshot. It's easy to handle the ex-data directly, and then we don't have to keep slingshot's potentially surprising behaviors in mind, e.g. (try+ ... (catch Exception ex ...)) may not actually catch ex. cf. scgilardi/slingshot#24 scgilardi/slingshot#52
rbrw
added a commit
to rbrw/trapperkeeper
that referenced
this issue
Feb 26, 2020
While we're reworking this code, remove slingshot. It's easy to handle the ex-data directly, and then we don't have to keep slingshot's potentially surprising behaviors in mind, e.g. (try+ ... (catch Exception ex ...)) may not actually catch ex. cf. scgilardi/slingshot#24 scgilardi/slingshot#52
rbrw
added a commit
to rbrw/trapperkeeper
that referenced
this issue
Feb 26, 2020
While we're reworking this code, remove slingshot. It's easy to handle the ex-data directly, and then we don't have to keep slingshot's potentially surprising behaviors in mind, e.g. (try+ ... (catch Exception ex ...)) may not actually catch ex. cf. scgilardi/slingshot#24 scgilardi/slingshot#52
rbrw
added a commit
to rbrw/trapperkeeper
that referenced
this issue
Feb 26, 2020
While we're reworking this code, remove slingshot. It's easy to handle the ex-data directly, and then we don't have to keep slingshot's potentially surprising behaviors in mind, e.g. (try+ ... (catch Exception ex ...)) may not actually catch ex. cf. scgilardi/slingshot#24 scgilardi/slingshot#52
rbrw
added a commit
to rbrw/trapperkeeper
that referenced
this issue
Feb 26, 2020
While we're reworking this code, remove slingshot. It's easy to handle the ex-data directly, and then we don't have to keep slingshot's potentially surprising behaviors in mind, e.g. (try+ ... (catch Exception ex ...)) may not actually catch ex. cf. scgilardi/slingshot#24 scgilardi/slingshot#52
rbrw
added a commit
to rbrw/trapperkeeper
that referenced
this issue
Mar 6, 2020
While we're reworking this code, remove slingshot. It's easy to handle the ex-data directly, and then we don't have to keep slingshot's potentially surprising behaviors in mind, e.g. (try+ ... (catch Exception ex ...)) may not actually catch ex. cf. scgilardi/slingshot#24 scgilardi/slingshot#52
rbrw
added a commit
to rbrw/trapperkeeper
that referenced
this issue
Mar 6, 2020
While we're reworking this code, remove slingshot. It's easy to handle the ex-data directly, and then we don't have to keep slingshot's potentially surprising behaviors in mind, e.g. (try+ ... (catch Exception ex ...)) may not actually catch ex. cf. scgilardi/slingshot#24 scgilardi/slingshot#52
rbrw
added a commit
to rbrw/trapperkeeper
that referenced
this issue
Mar 6, 2020
While we're reworking this code, remove slingshot. It's easy to handle the ex-data directly, and then we don't have to keep slingshot's potentially surprising behaviors in mind, e.g. (try+ ... (catch Exception ex ...)) may not actually catch ex. cf. scgilardi/slingshot#24 scgilardi/slingshot#52
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
It looks like slingshot gets a bit confused with chained exceptions, specifically when the outer exception is a regular one, and the cause is the slingshot wrapper:
Here things seem to behave as expected. But consider what happens if the only change I make is replace the second
try
withtry+
:What seems to be happening is that under
try+
(catch Exception e
block doesn't match anything. I looked at the expanded code and it seems like Slingshot is under the impression that this exception is still a wrapped exception (and it initializes:object &throw-context
accordingly) even though the wrapped exception is the cause and the main one is ajava.lang.Exception
.Needless to say, this is pretty confusing. Am I missing something?
The text was updated successfully, but these errors were encountered: