Skip to content

Instantly share code, notes, and snippets.

@zlx
Created March 24, 2014 14:45
Show Gist options
  • Save zlx/9741494 to your computer and use it in GitHub Desktop.
Save zlx/9741494 to your computer and use it in GitHub Desktop.
module NoDoubleRaise
def error_handled!
$! = nil
end
def raise(*args)
if $! && args.first != $!
warn "Double raise at #{caller.first}, aborting"
exit! false
else
super
end
end
end
class Object
include NoDoubleRaise
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment