lib/dor/services/client/marcxml.rb in dor-services-client-6.35.0 vs lib/dor/services/client/marcxml.rb in dor-services-client-6.36.0
- old
+ new
@@ -19,10 +19,11 @@
end
return resp.body if resp.success? && resp.body.present?
# This method needs its own exception handling logic due to how the endpoint service (SearchWorks) operates
+ # raise a NotFoundResponse because the resource being requested was not found in the ILS (via dor-services-app)
raise NotFoundResponse, ResponseErrorFormatter.format(response: resp) if resp.success? && resp.body.blank?
raise UnexpectedResponse, ResponseErrorFormatter.format(response: resp)
end
@@ -40,13 +41,15 @@
req.params['barcode'] = barcode unless barcode.nil?
req.params['catkey'] = catkey unless catkey.nil?
end
# This method needs its own exception handling logic due to how the endpoint service (Symphony) operates
- #
+
# DOR Services App does not respond with a 404 when no match in Symphony.
# Rather, it responds with a 500 containing "Record not found in Symphony" in the body.
+ # raise a NotFoundResponse because the resource being requested was not found in the ILS (via dor-services-app)
raise NotFoundResponse, ResponseErrorFormatter.format(response: resp) if !resp.success? && resp.body.match?(/Record not found in Symphony/)
+
raise UnexpectedResponse, ResponseErrorFormatter.format(response: resp) unless resp.success?
resp.body
end