Skip to content

Commit

Permalink
[TAN-2469] Use has_attribute?
Browse files Browse the repository at this point in the history
  • Loading branch information
jinjagit committed Aug 21, 2024
1 parent cd4dd19 commit e84c758
Showing 1 changed file with 6 additions and 6 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.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?(:response)
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)
end

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

0 comments on commit e84c758

Please sign in to comment.