Skip to content

Instantly share code, notes, and snippets.

@atruskie
Created September 8, 2016 05:29
Show Gist options
  • Save atruskie/e695d35dda5b38cc7912ea9bfe84e7df to your computer and use it in GitHub Desktop.
Save atruskie/e695d35dda5b38cc7912ea9bfe84e7df to your computer and use it in GitHub Desktop.
ruby exceptions answers
2.3.1 :070 > me false
inside
rescue
inside error
re raising
ensure
RuntimeError: inside error
from (irb):55:in `me'
from (irb):70
from /usr/local/rvm/rubies/ruby-2.3.1/bin/irb:11:in `<main>'
2.3.1 :069 > me true
inside
rescue
inside error
re raising
ensure
RuntimeError: ensure error
from (irb):63:in `ensure in me'
from (irb):63:in `me'
from (irb):69
from /usr/local/rvm/rubies/ruby-2.3.1/bin/irb:11:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment