From 5ec698366a524583063cefb84d652084e2841788 Mon Sep 17 00:00:00 2001 From: f Date: Mon, 20 Mar 2023 11:46:21 -0300 Subject: [PATCH] fix: capturar standard error --- app/jobs/gitlab_notifier_job.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/jobs/gitlab_notifier_job.rb b/app/jobs/gitlab_notifier_job.rb index 291112a5..fb25be10 100644 --- a/app/jobs/gitlab_notifier_job.rb +++ b/app/jobs/gitlab_notifier_job.rb @@ -61,7 +61,7 @@ class GitlabNotifierJob < ApplicationJob Rails.cache.write(cache_key, issue_data) # Si este trabajo genera una excepción va a entrar en un loop, así que # la notificamos por correo - rescue Exception => e + rescue StandardError => e email_notification.call(e, data: @issue) email_notification.call(exception, data: options) end @@ -89,7 +89,9 @@ class GitlabNotifierJob < ApplicationJob end def errors - options.dig(:data, :params, 'errors') if options.dig(:data, :params).is_a? Hash + return '' unless javascript? + + options.dig(:data, :params, 'errors') end # Define si es una excepción de javascript o local