lib/prss/links.rb in prss-0.2.2 vs lib/prss/links.rb in prss-0.2.3
- old
+ new
@@ -1,11 +1,15 @@
require 'rexml/document'
require 'uri'
module PRSS
class Links
+ class InvalidXMLError < StandardError; end
+
def initialize(xml)
@xml = ::REXML::Document.new(xml)
+ rescue REXML::ParseException
+ raise InvalidXMLError
end
attr_reader :xml
def links