-
-
Notifications
You must be signed in to change notification settings - Fork 933
Closed
Milestone
Description
def raise_rescue!
[ 1 ].each do # removing block gets cause to be nil
begin
raise StandardError.new("err")
rescue => e
puts("ERROR #{e.object_id} #{e.cause ? print_cause(e) : 'nil cause'}")
return # problematic 'early' return
end
end
end
def print_cause(e)
cause = e.cause
"cause: #{cause.object_id} #{cause.cause && print_cause(cause)}"
end
3.times do
raise_rescue!
endexpected: like MRI 3x nil cause
ERROR 47192120218900 nil cause
ERROR 47192120217920 nil cause
ERROR 47192120217540 nil cause
actual:
jruby 9.2.10.0-SNAPSHOT (2.5.7) 2019-12-31 fe4b188 Java HotSpot(TM) 64-Bit Server VM 11.0.2+9-LTS on 11.0.2+9-LTS +jit [linux-x86_64]
ERROR 2000 nil cause
ERROR 2002 cause: 2000
ERROR 2004 cause: 2002 cause: 2000