lib/harvestdor/purl_xml.rb in harvestdor-0.3.1 vs lib/harvestdor/purl_xml.rb in harvestdor-0.3.2

- old
+ new

@@ -13,11 +13,11 @@ # @param [String] purl_url url for the purl server. default is Harvestdor::PURL_DEFAULT # @return [Nokogiri::XML::Document] the MODS for the fedora object def self.mods druid, purl_url = Harvestdor::PURL_DEFAULT begin Nokogiri::XML(http_client.get("#{purl_url}/#{druid}.mods").body,nil,'UTF-8') - rescue Faraday::Error::ClientError + rescue Faraday::ClientError raise Harvestdor::Errors::MissingMods.new(druid) end end # the public xml for this fedora object, from the purl page @@ -28,11 +28,11 @@ return druid if druid.instance_of?(Nokogiri::XML::Document) begin ng_doc = Nokogiri::XML(http_client.get("#{purl_url}/#{druid}.xml").body) raise Harvestdor::Errors::MissingPublicXml.new(druid) if !ng_doc || ng_doc.children.empty? ng_doc - rescue Faraday::Error::ClientError + rescue Faraday::ClientError raise Harvestdor::Errors::MissingPurlPage.new(druid) end end # the contentMetadata for this fedora object, from the purl xml @@ -145,11 +145,11 @@ conn.use Faraday::Response::RaiseError conn.request :retry, max: 5, interval: 0.05, interval_randomness: 0.5, backoff_factor: 2, - exceptions: ['Errno::ECONNRESET', 'Errno::ETIMEDOUT', 'Timeout::Error', 'Faraday::Error::TimeoutError', 'Faraday::Error::ConnectionFailed'] + exceptions: ['Errno::ECONNRESET', 'Errno::ETIMEDOUT', 'Timeout::Error', 'Faraday::TimeoutError', 'Faraday::ConnectionFailed'] end end private_class_method :http_client -end # module Harvestdor \ No newline at end of file +end # module Harvestdor