Sha256: 4b6c804d63f231b72a7f2e11d7bdeb554ef1ed4d5dc5086b75b7e32e373a7fd2

Contents?: true

Size: 670 Bytes

Versions: 8

Compression:

Stored size: 670 Bytes

Contents

require 'sidekiq/exception_handler'
require 'getaround_utils/utils/deep_key_value'

module GetaroundUtils; end
module GetaroundUtils::Patches; end

class GetaroundUtils::Patches::KeyValueSidekiqExceptions
  module ExceptionHandlerLogger
    def call(exception, ctx)
      payload = {}
      payload[:message] = exception.message
      payload[:exception] = exception.class.name
      payload[:backtrace] = exception.backtrace&.join("\n")
      payload[:sidekiq] = ctx
      Sidekiq.logger.warn(GetaroundUtils::Utils::DeepKeyValue.serialize(payload.compact))
    end
  end

  def self.enable
    Sidekiq::ExceptionHandler::Logger.prepend ExceptionHandlerLogger
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
getaround_utils-0.1.20 lib/getaround_utils/patches/key_value_sidekiq_exceptions.rb
getaround_utils-0.1.19 lib/getaround_utils/patches/key_value_sidekiq_exceptions.rb
getaround_utils-0.1.18 lib/getaround_utils/patches/key_value_sidekiq_exceptions.rb
getaround_utils-0.1.17 lib/getaround_utils/patches/key_value_sidekiq_exceptions.rb
getaround_utils-0.1.15 lib/getaround_utils/patches/key_value_sidekiq_exceptions.rb
getaround_utils-0.1.14 lib/getaround_utils/patches/key_value_sidekiq_exceptions.rb
getaround_utils-0.1.13 lib/getaround_utils/patches/key_value_sidekiq_exceptions.rb
getaround_utils-0.1.12 lib/getaround_utils/patches/key_value_sidekiq_exceptions.rb