mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 11:06:23 +00:00
Merge branch 'issue-10031' into panel.sutty.nl
This commit is contained in:
commit
edae421e7e
1 changed files with 16 additions and 5 deletions
|
@ -16,7 +16,7 @@ class GitlabNotifierJob < ApplicationJob
|
|||
# @param [Hash] opciones de ExceptionNotifier
|
||||
def perform(exception, **options)
|
||||
@exception = exception
|
||||
@options = options
|
||||
@options = fix_options options
|
||||
@issue_data = { count: 1 }
|
||||
# Necesitamos saber si el issue ya existía
|
||||
@cached = false
|
||||
|
@ -63,7 +63,7 @@ class GitlabNotifierJob < ApplicationJob
|
|||
# la notificamos por correo
|
||||
rescue StandardError => e
|
||||
email_notification.call(e, data: @issue)
|
||||
email_notification.call(exception, data: options)
|
||||
email_notification.call(exception, data: @options)
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -88,10 +88,9 @@ class GitlabNotifierJob < ApplicationJob
|
|||
].join('/')
|
||||
end
|
||||
|
||||
# @return [Array]
|
||||
def errors
|
||||
return '' unless javascript?
|
||||
|
||||
options.dig(:data, :params, 'errors')
|
||||
options.dig(:data, :params, 'errors') || []
|
||||
end
|
||||
|
||||
# Define si es una excepción de javascript o local
|
||||
|
@ -288,4 +287,16 @@ class GitlabNotifierJob < ApplicationJob
|
|||
def url
|
||||
@url ||= request&.url || options.dig(:data, :params, 'context', 'url')
|
||||
end
|
||||
|
||||
# Define llaves necesarias
|
||||
#
|
||||
# @param :options [Hash]
|
||||
# @return [Hash]
|
||||
def fix_options(options)
|
||||
options = { data: options } unless options.is_a? Hash
|
||||
options[:data] ||= {}
|
||||
options[:data][:params] ||= {}
|
||||
|
||||
options
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue