summaryrefslogtreecommitdiff
path: root/lib/rss/rss.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-12 20:17:29 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-12 20:17:29 +0000
commit78e06ab19423518300a2ef9478cef69468e9d4a9 (patch)
treed1b8a3f97e830b41b3e4720e25ccd486590b4517 /lib/rss/rss.rb
parent73707bb42bc9d33f6baf9d82b01604284f3c1725 (diff)
* lib/rss/atom.rb (module RSS): Document URIs. Patch by Mark Turner.
[Ruby 1.9 - #4671] * lib/rss/rss.rb (module RSS): Document exception classes. Patch by Mark Turner. [Ruby 1.9 - #4671] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rss/rss.rb')
-rw-r--r--lib/rss/rss.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/rss/rss.rb b/lib/rss/rss.rb
index 28d8cce30d..82ab6c7cd3 100644
--- a/lib/rss/rss.rb
+++ b/lib/rss/rss.rb
@@ -70,6 +70,9 @@ module RSS
class InvalidRSSError < Error; end
+ ##
+ # Raised if no matching tag is found.
+
class MissingTagError < InvalidRSSError
attr_reader :tag, :parent
def initialize(tag, parent)
@@ -78,6 +81,9 @@ module RSS
end
end
+ ##
+ # Raised if there are more occurrences of the tag than expected.
+
class TooMuchTagError < InvalidRSSError
attr_reader :tag, :parent
def initialize(tag, parent)
@@ -86,6 +92,9 @@ module RSS
end
end
+ ##
+ # Raised if a required attribute is missing.
+
class MissingAttributeError < InvalidRSSError
attr_reader :tag, :attribute
def initialize(tag, attribute)
@@ -94,6 +103,9 @@ module RSS
end
end
+ ##
+ # Raised when an unknown tag is found.
+
class UnknownTagError < InvalidRSSError
attr_reader :tag, :uri
def initialize(tag, uri)
@@ -102,6 +114,9 @@ module RSS
end
end
+ ##
+ # Raised when an unexpected tag is encountered.
+
class NotExpectedTagError < InvalidRSSError
attr_reader :tag, :uri, :parent
def initialize(tag, uri, parent)
@@ -112,6 +127,9 @@ module RSS
# 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)
@@ -123,6 +141,9 @@ module RSS
end
end
+ ##
+ # Raised when an unknown conversion error occurs.
+
class UnknownConversionMethodError < Error
attr_reader :to, :from
def initialize(to, from)
@@ -134,6 +155,9 @@ module RSS
# for backward compatibility
UnknownConvertMethod = UnknownConversionMethodError
+ ##
+ # Raised when a conversion failure occurs.
+
class ConversionError < Error
attr_reader :string, :to, :from
def initialize(string, to, from)
@@ -144,6 +168,9 @@ module RSS
end
end
+ ##
+ # Raised when a required variable is not set.
+
class NotSetError < Error
attr_reader :name, :variables
def initialize(name, variables)
@@ -153,6 +180,9 @@ module RSS
end
end
+ ##
+ # Raised when a RSS::Maker attempts to use an unknown maker.
+
class UnsupportedMakerVersionError < Error
attr_reader :version
def initialize(version)