Project

General

Profile

Actions

Backport #9297

closed

`Exception#backtrace_locations` returns `nil`

Added by ko1 (Koichi Sasada) over 10 years ago. Updated over 10 years ago.

Status:
Closed

Description

=begin
If I raise an ArgumentError by calling a method with wrong number of arguments, Exception#backtrace_locations returns nil, which I think is a bug:

def foo; end

begin
  foo(:bar)
rescue => e
  p e.backtrace_locations
end
# => nil

If, instead, I raise an error manually, then it returns an array as expected:

begin
  raise ArgumentError.new
rescue => e
  p e.backtrace_locations
end
# => ["this_file:2:in `<main>'"]

=end

Actions #1

Updated by ko1 (Koichi Sasada) over 10 years ago

Please backport r44411 to fix an issue reported at Bug #9295.

Actions #2

Updated by naruse (Yui NARUSE) over 10 years ago

  • Status changed from Assigned to Closed

Merged in r44431

Actions

Also available in: Atom PDF

Like0
Like0Like0