Back to home

Ruby Error Handling main image

Ruby Error Handling

This is a basic example of raising and exception and rescueing the thrown exception.

1 2 3 4 5 6 7 8 9 10 def raise_and_rescue begin puts 'I am before the raise.' raise 'An error has occured.' puts 'I am after the raise.' rescue puts 'I am rescued.' end puts 'I am after the begin block.' end

Dennis O'Keeffe

@dennisokeeffe92
  • Melbourne, Australia

Hi, I am a professional Software Engineer. Formerly of Culture Amp, UsabilityHub, Present Company and NightGuru.
I am currently working on workingoutloud.dev, Den Dribbles and LandPad .

Related articles


1,200+ PEOPLE ALREADY JOINED ❤️️

Get fresh posts + news direct to your inbox.

No spam. We only send you relevant content.