diff --git a/back/engines/commercial/analysis/app/lib/analysis/summarization_method/base.rb b/back/engines/commercial/analysis/app/lib/analysis/summarization_method/base.rb index de569ea1f913..6dbb57f9ed9d 100644 --- a/back/engines/commercial/analysis/app/lib/analysis/summarization_method/base.rb +++ b/back/engines/commercial/analysis/app/lib/analysis/summarization_method/base.rb @@ -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)