Skip to content

Instantly share code, notes, and snippets.

@puneetpandey
Created December 30, 2013 09:08
Show Gist options
  • Save puneetpandey/8179646 to your computer and use it in GitHub Desktop.
Save puneetpandey/8179646 to your computer and use it in GitHub Desktop.
begin
# Code to be executed here
# This part will be 'protected'
raise # Use this to raise any message
rescue
# Exception Handling, like argument error, 404
retry # use this if you want the begin block to be executed again, if execption occurs.
ensure
# This part will always get executed.
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment