Skip to content

Commit

Permalink
[TAN-2469] Check for specific error class, not has_attribute?
Browse files Browse the repository at this point in the history
  • Loading branch information
jinjagit committed Aug 22, 2024
1 parent e84c758 commit 54a367d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ def execute(plan)
task.set_succeeded!
rescue SummarizationFailedError, Faraday::BadRequestError => e
extra = {}
if e.has_attribute?(:response)
if e.instance_of?('Faraday::BadRequestError')
extra[:response] = e&.response
extra[:response_headers] = e&.response&.headers
extra[:response_body] = e&.response&.body
extra[:response_status] = e&.response&.status
extra[:backtrace] = e&.backtrace if e.has_attribute?(:backtrace)
extra[:backtrace] = e&.backtrace
end

ErrorReporter.report(e, extra: extra)
Expand Down

0 comments on commit 54a367d

Please sign in to comment.