sidekiq_middlewares 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1af97e8dd2479218ef77a849fb2f4952fdcc44f1
4
- data.tar.gz: 62e9c7c0888bc47a4db507175ad677c9c21923c4
3
+ metadata.gz: 534f7313bae3b08136b2f08384da9df76280efaa
4
+ data.tar.gz: eee717e967de126db6387e50be66b13babdf8aa2
5
5
  SHA512:
6
- metadata.gz: 47643629b52194c5692989f95f83efe4465d12360d239bffbd0946734e5af11db733f49125c884bc559f23961635fdaef2b7101314fd792618170be2ed9e44ff
7
- data.tar.gz: 59f8b9e2b56dc03c8d0cb1818015ececd4ac085e5eff7baa49c04a210f6d51a9869431ca7a642641663ec1704482246e4634010c7b0c0fac41f2d5748ab25d03
6
+ metadata.gz: e35e6901b3238abc187755126733391eecf37c5516622e4ccab92f954785b0d6e36f475efc591921fae062d29a47ec2293cb693791b8a3d44bf12992f282cca3
7
+ data.tar.gz: 675657f10a096beb5369a2f7481e29b0a6c590eb4a167cc110dd98034e0f521bd14977da863ce53cb3a2bb4c3eaa7c0ec9b223238ab926948a55e0d3ffe732a4
@@ -1,14 +1,15 @@
1
1
  module SidekiqMiddlewares
2
2
  class ErrorLogger
3
- def initialize(logger)
4
- @logger = logger
3
+ def initialize(opts = {})
4
+ @logger = opts[:logger] || raise(ArgumentError, 'missing keyword: logger')
5
+ @formatter = opts[:formatter] || proc { |message| message }
5
6
  end
6
7
 
7
8
  def call(*_args)
8
9
  begin
9
10
  yield
10
11
  rescue => ex
11
- @logger.error ex
12
+ @logger.error(@formatter.call(ex))
12
13
  raise
13
14
  end
14
15
  end
@@ -1,3 +1,3 @@
1
1
  module SidekiqMiddlewares
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq_middlewares
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emarsys Smart Insight Team