Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rubocop Style/CaseLikeIf enabled as bug was fixed #4169

Merged
merged 1 commit into from Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .rubocop.yml
Expand Up @@ -176,7 +176,7 @@ Style/BisectedAttrAccessor:
Enabled: true

Style/CaseLikeIf:
Enabled: false # Here be dragons https://github.com/rubocop-hq/rubocop/issues/8508
Enabled: true

Style/ExplicitBlockArgument:
Enabled: true
Expand Down
12 changes: 6 additions & 6 deletions app/models/symphony_reader.rb
Expand Up @@ -70,16 +70,16 @@ def fetch_marc_response
def symphony_response(url)
resp = client.get(url)

if resp.status == 200
case resp.status
when 200
validate_response(resp)
return resp
elsif resp.status == 404
raise NotFound, "Record not found in Symphony. Catkey: #{catkey}. API call: #{url}"
resp
when 404
raise NotFound, "Record not found in Symphony. Catkey: #{catkey}. API call: #{url}" if resp.status == 404
else
errmsg = "Got HTTP Status-Code #{resp.status} calling #{url}: #{resp.body}"
raise ResponseError, errmsg
end

raise ResponseError, errmsg
rescue Faraday::TimeoutError => e
errmsg = "Timeout for Symphony response for API call #{url}: #{e}"
Honeybadger.notify(errmsg)
Expand Down