Sha256: fb234e5b5572c9d94dededca5294e87c3d9a2433c0d8d8f6909bc79188543914
Contents?: true
Size: 881 Bytes
Versions: 25
Compression:
Stored size: 881 Bytes
Contents
# frozen_string_literal: true require 'sidekiq' module Sidekiq module ExceptionHandler class Logger def call(ex, ctxHash) Sidekiq.logger.warn(Sidekiq.dump_json(ctxHash)) if !ctxHash.empty? Sidekiq.logger.warn "#{ex.class.name}: #{ex.message}" Sidekiq.logger.warn ex.backtrace.join("\n") unless ex.backtrace.nil? end # Set up default handler which just logs the error Sidekiq.error_handlers << Sidekiq::ExceptionHandler::Logger.new end def handle_exception(ex, ctxHash={}) Sidekiq.error_handlers.each do |handler| begin handler.call(ex, ctxHash) rescue => ex Sidekiq.logger.error "!!! ERROR HANDLER THREW AN ERROR !!!" Sidekiq.logger.error ex Sidekiq.logger.error ex.backtrace.join("\n") unless ex.backtrace.nil? end end end end end
Version data entries
25 entries across 25 versions & 2 rubygems