From: "mame (Yusuke Endoh)" Date: 2012-11-25T09:50:12+09:00 Subject: [ruby-core:50056] [ruby-trunk - Bug #7430][Rejected] 'unexpected return' occurs when call a Proc that returning value in rescue Issue #7430 has been updated by mame (Yusuke Endoh). Status changed from Open to Rejected This is the spec. To exit from Proc, use next instead of return. p = Proc.new do begin 1 / 0 rescue next "error handled by proc" end end p.call You can use return to exit from lambda. p = lambda do begin 1 / 0 rescue return "error handled by proc" end end p.call -- Yusuke Endoh ---------------------------------------- Bug #7430: 'unexpected return' occurs when call a Proc that returning value in rescue https://bugs.ruby-lang.org/issues/7430#change-33833 Author: danilo.s.coelho (Danilo Coelho) Status: Rejected Priority: Normal Assignee: Category: Target version: ruby -v: ruby 1.9.3p286 (2012-10-12) [i386-mingw32] p = Proc.new do begin 1 / 0 rescue return "error handled by proc" end end p.call -- http://bugs.ruby-lang.org/