-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Exception#cause
is difference behavior with CRuby 2.3.0
#3654
Comments
@hsbt I would say we are just doing the wrong thing here. We will fix it. |
I'm not sure this is correct behavior in MRI, and I'll explain why. In the differing case, begin
begin
raise 'a'
rescue => a
begin
raise 'b'
rescue => b
p [b, b.cause]
begin
raise 'c'
rescue
raise b
end
end
end
rescue
p [$!, $!.cause]
end And the output in JRuby 9.0.5.0 and MRI 2.3.0:
MRI is losing the original cause of the exception, without it being physically replaced. I'm going to report this as a bug. Interestingly, JRuby 9.1 (ruby-2.3 branch) appears to work like Ruby 2.3, so somewhere along the way we "fixed" this:
|
Filed https://bugs.ruby-lang.org/issues/12068 If they disagree (and I will argue the point) then I guess we've already fixed this. If they agree, we'll need to reinstate 9.0.5.0's behavior. |
They agreed, so we need to fix 9.1 to work like 9.0 did. |
I found difference behavior of
Exception#cause
with CRuby 2.3.0. I invoke following codes. There are part of Rake test code.I got following results.
Is JRuby results intentional behavior? If it's yes, I will fix rake tests.
The text was updated successfully, but these errors were encountered: