1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/spec/ruby/command_line/fixtures/backtrace.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
286 B
Ruby
Raw Normal View History

2021-10-20 15:41:46 -04:00
def a
2021-10-28 12:54:01 -04:00
raise 'oops'
2021-10-20 15:41:46 -04:00
end
def b
a
end
def c
b
end
def d
c
end
arg = ARGV.first
$stderr.puts arg
case arg
when 'full_message'
begin
d
rescue => exc
puts exc.full_message
end
when 'backtrace'
begin
d
rescue => exc
puts exc.backtrace
end
else
d
end