Catch XML syntax errors

This commit is contained in:
Eugen Rochko 2016-09-30 23:06:11 +02:00
parent 868cfbe0d8
commit 3fae9826cf
3 changed files with 4 additions and 2 deletions

View File

@ -1,7 +1,7 @@
PATH
remote: .
specs:
goldfinger (1.0.4)
goldfinger (1.0.5)
addressable (~> 2.4)
http (~> 2.0)
nokogiri (~> 1.6)

View File

@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'goldfinger'
s.version = '1.0.4'
s.version = '1.0.5'
s.platform = Gem::Platform::RUBY
s.required_ruby_version = '>= 2.0.0'
s.date = '2016-02-17'

View File

@ -47,6 +47,8 @@ module Goldfinger
raise Goldfinger::NotFoundError if links.empty?
links.first.attribute('template').value.gsub('{uri}', @uri)
rescue Nokogiri::XML::XPath::SyntaxError
raise Goldfinger::Error, 'Bad XML'
end
def domain