Skip to content

Instantly share code, notes, and snippets.

Created May 7, 2013 13:03
Show Gist options
  • Save anonymous/5532383 to your computer and use it in GitHub Desktop.
Save anonymous/5532383 to your computer and use it in GitHub Desktop.
module Ox
class Error < StandardError
end # Error
# An Exception that is raised as a result of a parse error while parsing a XML document.
class ParseError < Error
end # ParseError
# An Exception that is raised as a result of an invalid argument.
class ArgError < Error
end # ArgError
# An Exception raised if a path is not valid.
class InvalidPath < Error
def initialize(path)
super("#{path.join('/')} is not a valid location.")
end
end # InvalidPath
end # Ox
irb(main):001:0> require 'ox'
true
irb(main):002:0> defined?(Ox::InvalidPath)
"constant"
irb(main):003:0> defined?(Ox::ParseError)
nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment