Skip to content

Instantly share code, notes, and snippets.

@jeremy
Created August 20, 2016 02:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeremy/712a01d40cc9fa3765ee330d2b050777 to your computer and use it in GitHub Desktop.
Save jeremy/712a01d40cc9fa3765ee330d2b050777 to your computer and use it in GitHub Desktop.
Reraising an exception never amends its backtrace
def foo
e = RuntimeError.new
def e.backtrace() %w[ lol rofl ] end
raise e
rescue => e
raise e
end
foo
# Same result on 1.8, 1.9, 2.3, 2.4:
# lol: RuntimeError (RuntimeError)
# from rofl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment