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
2021-10-28 18:54:01 +02:00

35 lines
286 B
Ruby

def a
raise 'oops'
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