Project

General

Profile

Feature #4671 ยป 0001-Adding-descriptions-to-a-few-RSS-error-classes.-Adde.patch

amerine (Mark Turner), 05/12/2011 11:31 AM

View differences:

lib/rss/atom.rb
module RSS
module Atom
##
# The Atom URI W3C Namespace
URI = "http://www.w3.org/2005/Atom"
##
# The XHTML URI W3C Namespace
XHTML_URI = "http://www.w3.org/1999/xhtml"
module CommonModel
lib/rss/rss.rb
class InvalidRSSError < Error; end
##
# Raised if no matching tag is found.
class MissingTagError < InvalidRSSError
attr_reader :tag, :parent
def initialize(tag, parent)
......
end
end
##
# Raised if there are more occurrences of the tag than expected.
class TooMuchTagError < InvalidRSSError
attr_reader :tag, :parent
def initialize(tag, parent)
......
end
end
##
# Raised if a required attribute is missing.
class MissingAttributeError < InvalidRSSError
attr_reader :tag, :attribute
def initialize(tag, attribute)
......
end
end
##
# Raised when an unknown tag is found.
class UnknownTagError < InvalidRSSError
attr_reader :tag, :uri
def initialize(tag, uri)
......
end
end
##
# Raised when an unexpected tag is encountered.
class NotExpectedTagError < InvalidRSSError
attr_reader :tag, :uri, :parent
def initialize(tag, uri, parent)
......
# For backward compatibility :X
NotExceptedTagError = NotExpectedTagError
##
# Raised when an incorrect value is used.
class NotAvailableValueError < InvalidRSSError
attr_reader :tag, :value, :attribute
def initialize(tag, value, attribute=nil)
......
end
end
##
# Raised when an unknown conversion error occurs.
class UnknownConversionMethodError < Error
attr_reader :to, :from
def initialize(to, from)
......
# for backward compatibility
UnknownConvertMethod = UnknownConversionMethodError
##
# Raised when a conversion failure occurs.
class ConversionError < Error
attr_reader :string, :to, :from
def initialize(string, to, from)
......
end
end
##
# Raised when a required variable is not set.
class NotSetError < Error
attr_reader :name, :variables
def initialize(name, variables)
......
end
end
##
# Raised when a RSS::Maker attempts to use an unknown maker.
class UnsupportedMakerVersionError < Error
attr_reader :version
def initialize(version)
    (1-1/1)