Issue #22191 has been updated by nobu (Nobuyoshi Nakada). Related bug: when two `END` raise exceptions, the same message is printed multiple times. ```console $ ruby -e 'END{raise "END1"};END{raise "END2"}' -e:1:in 'block (2 levels) in <main>': END2 (RuntimeError) -e:1:in 'block (2 levels) in <main>': END1 (RuntimeError) -e:1:in 'block (2 levels) in <main>': END2 (RuntimeError) ``` ```console $ ruby -e 'END{raise "END1"};END{raise "END2"};END{raise "END3"}' -e:1:in 'block (2 levels) in <main>': END3 (RuntimeError) -e:1:in 'block (2 levels) in <main>': END2 (RuntimeError) -e:1:in 'block (2 levels) in <main>': END3 (RuntimeError) -e:1:in 'block (2 levels) in <main>': END1 (RuntimeError) -e:1:in 'block (2 levels) in <main>': END2 (RuntimeError) -e:1:in 'block (2 levels) in <main>': END3 (RuntimeError) ``` ---------------------------------------- Bug #22191: `Signal.trap(:EXIT)` exception only shown if `at_exit` also raises https://bugs.ruby-lang.org/issues/22191#change-118062 * Author: Earlopain (Earlopain _) * Status: Open * ruby -v: ruby 4.1.0dev (2026-05-29T14:34:40Z master 7a07a54298) +PRISM [x86_64-linux] * Backport: 3.3: REQUIRED, 3.4: REQUIRED, 4.0: REQUIRED ---------------------------------------- ```rb Signal.trap(:EXIT, proc { raise "foo" }) # No output ``` ```rb Signal.trap(:EXIT, proc { raise "foo" }) at_exit { raise "bar" } # test.rb:2:in 'block in <main>': bar (RuntimeError) # test.rb:1:in 'block in <main>': foo (RuntimeError) ``` A bit weird -- https://bugs.ruby-lang.org/