Skip to content

Instantly share code, notes, and snippets.

@igaiga
Created September 30, 2011 02:42
Show Gist options
  • Save igaiga/1252519 to your computer and use it in GitHub Desktop.
Save igaiga/1252519 to your computer and use it in GitHub Desktop.
module AcmeHttp
module Error; end
end
begin
begin
raise IOError, "Some IO error"
rescue Exception => error
error.extend(AcmeHttp::Error)
# class << error; p self.ancestors; end
# p error.singleton_class.ancestors # for 1.9.2
raise
end
rescue AcmeHttp::Error => error
puts "Rescued AcmeHttp::Error: #{error}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment