[BlogEntry] Exception handling in Ruby

0

I'm not sure why every language feels the need to use its own keywords. What would be the crime if all languages used throw, raise, and catch?

Anyway, if you want to examine the Exception object in Ruby, in the rescue line, just add => e as in

    rescue => e

Now, the local variable, e, contains the Exception object, which you can log:

    $mylog.debug("In Rescue block: " + e)    

Leave a Reply

Your email address will not be published. Required fields are marked *

CommentLuv badge