ruby raise error
begin
3 + '4'
rescue => e
puts e.class
puts e.message
puts e.trace
end
4.11
10
raise "This is an exception"
Thank you!
10
0
4.6
5
raise StandardError.new "This is an exception"
Thank you!
5
0
4.22
9
raise Exception.new "This is an exception"
Thank you!
9
0
Are there any code examples left?
New code examples in category Other