5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-07-05 22:45:45 +00:00
panel/app/lib/exception_notifier/gitlab_notifier.rb

23 lines
562 B
Ruby
Raw Permalink Normal View History

# 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)
case exception
when BacktraceJob::BacktraceException
GitlabNotifierJob.perform_later(exception, **options)
else
GitlabNotifierJob.perform_now(exception, **options)
end
end
end
end