From c9e0ce9c38c66f9570f71f3769756af48e9b4a77 Mon Sep 17 00:00:00 2001 From: f Date: Fri, 16 Apr 2021 12:10:32 -0300 Subject: [PATCH 1/2] agregar el origen del error en el asunto --- app/jobs/backtrace_job.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/jobs/backtrace_job.rb b/app/jobs/backtrace_job.rb index 17755dc8..a1e95b22 100644 --- a/app/jobs/backtrace_job.rb +++ b/app/jobs/backtrace_job.rb @@ -36,7 +36,7 @@ class BacktraceJob < ApplicationJob end begin - raise BacktraceException, params['errors']&.first&.dig('message') + raise BacktraceException, "#{params.dig('context', 'url')}: #{params['errors']&.first&.dig('message')}" rescue BacktraceException => e ExceptionNotifier.notify_exception(e, data: { site: site.name, params: params, _backtrace: true }) end From 4b6e43b63d044f5350ccb3b47ba68130b9249f99 Mon Sep 17 00:00:00 2001 From: f Date: Wed, 21 Apr 2021 10:24:16 -0300 Subject: [PATCH 2/2] mostrar solo el origen del error --- app/jobs/backtrace_job.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/jobs/backtrace_job.rb b/app/jobs/backtrace_job.rb index a1e95b22..50ee155b 100644 --- a/app/jobs/backtrace_job.rb +++ b/app/jobs/backtrace_job.rb @@ -36,7 +36,7 @@ class BacktraceJob < ApplicationJob end begin - raise BacktraceException, "#{params.dig('context', 'url')}: #{params['errors']&.first&.dig('message')}" + raise BacktraceException, "#{origin}: #{params['errors']&.first&.dig('message')}" rescue BacktraceException => e ExceptionNotifier.notify_exception(e, data: { site: site.name, params: params, _backtrace: true }) end @@ -95,4 +95,11 @@ class BacktraceJob < ApplicationJob SourceMap::Map.from_hash data(map) end.reduce(&:+) end + + # @return [String] + def origin + URI.parse(params.dig('context', 'url')).host + rescue URI::Error + params.dig('context', 'url') + end end