[ruby-core:76989] [Ruby trunk Bug#12588] When an exception is re-raised in the "rescue" clause, the back trace does not contain the line in that clause

From: nobu@...
Date: 2016-08-20 02:37:08 UTC
List: ruby-core #76989
Issue #12588 has been updated by Nobuyoshi Nakada.


I think it's intentional, and don't see why it should contain a new line.

----------------------------------------
Bug #12588: When an exception is re-raised in the "rescue" clause, the back trace does not contain the line in that clause
https://bugs.ruby-lang.org/issues/12588#change-60212

* Author: Hiro Asari
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-darwin14]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
Given:

~~~
$ cat -n foo.rb 
     1  def foo
     2    raise StandardError
     3  rescue StandardError => e
     4    raise e
     5  end
     6
     7  foo
~~~

one would reasonably expect to see line 4 to be in the back trace when this file is executed, but one does not.

~~~
$ ruby -v foo.rb
ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-darwin14]
foo.rb:2:in `foo': StandardError (StandardError)
        from foo.rb:7:in `<main>'
~~~




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next