lib/preservation/client/versioned_api_service.rb in preservation-client-3.5.0 vs lib/preservation/client/versioned_api_service.rb in preservation-client-4.0.0
- old
+ new
@@ -29,11 +29,11 @@
rescue Faraday::ResourceNotFound
errmsg = "#{object_id} not found in Preservation at #{connection.url_prefix}#{req_url}"
raise NotFoundError, errmsg
rescue Faraday::Error => e
errmsg = "Preservation::Client.#{caller_locations.first.label} for #{object_id} " \
- "got #{e.response[:status]} from Preservation at #{req_url}: #{e.response[:body]}"
+ "got #{e.response[:status]} from Preservation at #{req_url}: #{e.response[:body]}"
raise UnexpectedResponseError, errmsg
end
# @param path [String] path to be appended to connection url (no leading slash)
# @param params [Hash] optional request parameters
@@ -88,14 +88,14 @@
errmsg = ResponseErrorFormatter.format(response: resp, client_method_name: caller_locations.first.label)
raise UnexpectedResponseError, errmsg
rescue Faraday::ResourceNotFound => e
errmsg = "Preservation::Client.#{caller_locations.first.label} " \
- "got #{e.response[:status]} from Preservation at #{req_url}: #{e.response[:body]}"
+ "got #{e.response[:status]} from Preservation at #{req_url}: #{e.response[:body]}"
raise NotFoundError, errmsg
rescue Faraday::Error => e
errmsg = "Preservation::Client.#{caller_locations.first.label} " \
- "got #{e.response[:status]} from Preservation at #{req_url}: #{e.response[:body]}"
+ "got #{e.response[:status]} from Preservation at #{req_url}: #{e.response[:body]}"
exception_class = e.response[:status] == 423 ? LockedError : UnexpectedResponseError
raise exception_class, errmsg
end
end
end