Ruby - Programming Language
This course covers the basics of programming in Ruby. Work your way through the videos and we'll teach you everything you need to know to start your programming journey!

Handling Errors

Lesson 28
Author : Mike Dane
Last Updated : November, 2017


Code

Copybegin
     # puts bad_variable
     num = 10/0
rescue ZeroDivisionError
     puts "Error"
rescue
     puts "All other errors"
end

# or raise an exception

raise "Made Up Exception"