Answers for "how to raise error in ruby"

0

ruby raise error

raise StandardError.new "This is an exception"
Posted by: Guest on January-04-2021
0

rails begin rescue

begin
  3 + '4'
rescue => e
  puts e.class
  puts e.message
  puts e.trace
end
Posted by: Guest on August-18-2020
0

ruby raise error

raise Exception.new "This is an exception"
Posted by: Guest on June-11-2021
0

ruby raise error

raise "This is an exception"
Posted by: Guest on June-11-2021

Browse Popular Code Answers by Language