2021-05-29 20:42:45 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module ExceptionNotifier
|
|
|
|
# Notifica las excepciones como incidencias en Gitlab
|
|
|
|
class GitlabNotifier
|
|
|
|
def initialize(_); end
|
|
|
|
|
|
|
|
# Recibe la excepción y empieza la tarea de notificación en segundo
|
|
|
|
# plano.
|
|
|
|
#
|
2023-06-14 16:33:47 +00:00
|
|
|
# @param :exception [Exception]
|
|
|
|
# @param :options [Hash]
|
|
|
|
def call(exception, options, &block)
|
2023-04-10 20:31:26 +00:00
|
|
|
case exception
|
|
|
|
when BacktraceJob::BacktraceException
|
|
|
|
GitlabNotifierJob.perform_later(exception, **options)
|
|
|
|
else
|
|
|
|
GitlabNotifierJob.perform_now(exception, **options)
|
|
|
|
end
|
2021-05-29 20:42:45 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|