ruby raise error code example
Example 1: rails begin rescue
begin
3 + '4'
rescue => e
puts e.class
puts e.message
puts e.trace
end
Example 2: ruby raise error
raise Exception.new "This is an exception"
Example 3: ruby raise error
raise StandardError.new "This is an exception"
Example 4: ruby raise error
raise "This is an exception"