Skip to content

Instantly share code, notes, and snippets.

@igrep
Created May 26, 2013 09:11
Show Gist options
  • Select an option

  • Save igrep/5652164 to your computer and use it in GitHub Desktop.

Select an option

Save igrep/5652164 to your computer and use it in GitHub Desktop.
class DefinitelyRescuedException < Exception
def is_a? _klass
true
end
def < _klass
true
end
def > _klass
false
end
end
class OrdinayException < Exception ; end
begin
raise DefinitelyRescuedException
rescue StandardError => e
puts "I rescued: #{e.class}"
end
begin
raise OrdinayException
rescue StandardError => e
puts "I rescued: #{e.class}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment