Skip to content

Commit b139640

Browse files
Update logging and libkey status handling
1 parent 042c203 commit b139640

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/models/libkey.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ def self.lookup(type:, identifier:, libkey_client: nil)
1616
return unless %w[doi pmid].include?(type)
1717

1818
url = libkey_url(type, identifier)
19-
Rails.logger.debug(url)
2019

2120
libkey_http = setup(url, libkey_client)
2221

@@ -27,7 +26,9 @@ def self.lookup(type:, identifier:, libkey_client: nil)
2726
json_response = JSON.parse(raw_response.to_s)
2827
extract_metadata(json_response)
2928
rescue LookupFailure => e
30-
Rails.logger.debug("Libkey responded with non-200 status: #{e.message}")
29+
Sentry.set_tags('mitlib.libkeyurl': url)
30+
Sentry.set_tags('mitlib.libkeystatus': e.message)
31+
Sentry.capture_message('Unexpected Libkey response status')
3132
nil
3233
rescue HTTP::Error
3334
Rails.logger.error('Libkey connection error')

0 commit comments

Comments
 (0)