Skip to content

Instantly share code, notes, and snippets.

@hynkle
Created October 31, 2012 14:07
Show Gist options
  • Save hynkle/3987210 to your computer and use it in GitHub Desktop.
Save hynkle/3987210 to your computer and use it in GitHub Desktop.
Raise As
# for those times you want to bubble an exception up, but want to put it in a different exception class
module Kernel
def raise_as(exception_class)
raise if $!.nil?
raise exception_class, $!.message, $!.backtrace
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment