Skip to main content

Benjamin Oakes

Photo of Ben Oakes

Hi, I'm Ben Oakes and this is my geek blog. Currently, I'm a Ruby/JavaScript Developer at Liaison. Previously, I was a Developer at Continuity and Hedgeye, a Research Assistant in the Early Social Cognition Lab at Yale University and a student at the University of Iowa. I also organize TechCorridor.io, ICRuby, OpenHack Iowa City, and previously organized NewHaven.rb. I have an amazing wife named Danielle Oakes.

Filtering for the month March, 2011. Clear

throw/catch vs. raise/rescue

by Ben

Just a piece of Ruby trivia: Ruby has both throw/catch as well as raise/rescue. Most newbie Rubyists don’t know this. There’s a section of the Pickaxe book that discusses them both.

Essentially, rescue is used for exceptions and error control while catch is used for symbols and flow control. The idea is that you shouldn’t use exceptions to change the flow of your program, but rather to handle errors.