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.
|
|
|
|
#
|
|
|
|
# @param [Exception]
|
|
|
|
# @param [Hash]
|
|
|
|
def call(exception, **options)
|
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
|