error_ready 0.1.1 → 0.2.2

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
  SHA256:
3
- metadata.gz: cbb22eefa22cb717fc57d46ce807c6c587f42346ca975a12cea49745eb0c585a
4
- data.tar.gz: b1cacd40f4c6df67a41b6678dd7498e23d3a584a97d10ab3882bfbb9feb67e8e
3
+ metadata.gz: 88e40828aed04f08df924a8b386920e906ce1472162464ca95ea0d37a3fb055f
4
+ data.tar.gz: baceecb2f30a2a10dc16cc01ebab8d5ea3bb6b859c0133721b1e7b6b261f0e9c
5
5
  SHA512:
6
- metadata.gz: 3e4600c348fc31858bccc1703289933de91631f97bf9fd4feefb8fe73394a41180f2db512471a6a11f3064225cb8c8f433c455e1c6eb1783e0ce2651410a0e39
7
- data.tar.gz: ac4b9ceb1fc00a377a7892ade04562041d2a8c123bc3dce551890d3d00d539aa9a0e6b9341736ed5291765ccfe88faeeff63f6f0ec83ef3d31d4fe44a29b924c
6
+ metadata.gz: 52f0dae0c57eb9d1fb25e9ab090e327842b46da90f62c3ab6f09cba8a0a270c1cba047034245e360b6e1217812ae17579f6a7b9410e7df630002f4d80dbb8722
7
+ data.tar.gz: 7832de3af358b5aacd21f7912dde86edb7b2fb9833362611b87022d8557e52c14829f9a6d8f2eddbf1e8e1e4101eccc224f15a98403073bde91d2ad524437b51
@@ -6,6 +6,14 @@ module ErrorReady
6
6
  Rails.error.subscribe(Subscriber.new)
7
7
  # register midddleware
8
8
  app.config.middleware.use(RackMiddleware)
9
+
10
+ if defined?(Sidekiq)
11
+ Sidekiq.configure_server do |config|
12
+ config.server_middleware do |chain|
13
+ chain.add(SidekiqMiddleware)
14
+ end
15
+ end
16
+ end
9
17
  end
10
18
  end
11
19
  end
@@ -12,7 +12,7 @@ module ErrorReady
12
12
  server_name: env["SERVER_NAME"],
13
13
  http_host: env["HTTP_HOST"],
14
14
  http_user_agent: env["HTTP_USER_AGENT"],
15
- session: env["rack.session"].to_h
15
+ session: env["rack.session"].to_json
16
16
  )
17
17
 
18
18
  Rails.error.record do
@@ -0,0 +1,12 @@
1
+ module ErrorReady
2
+ class SidekiqMiddleware
3
+ def call(worker, job, queue)
4
+ Rails.error.set_context(
5
+ params: job.to_json
6
+ )
7
+ Rails.error.record do
8
+ yield
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,3 +1,3 @@
1
1
  module ErrorReady
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.2"
3
3
  end
data/lib/error_ready.rb CHANGED
@@ -8,6 +8,7 @@ module ErrorReady
8
8
 
9
9
  # middlewares
10
10
  autoload :RackMiddleware, "error_ready/middlewares/rack_middleware"
11
+ autoload :SidekiqMiddleware, "error_ready/middlewares/sidekiq_middleware"
11
12
 
12
13
  # notifiers
13
14
  autoload :SyncSender, "error_ready/notifiers/sync_sender"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: error_ready
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moses Gathuku
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-19 00:00:00.000000000 Z
11
+ date: 2022-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -81,6 +81,7 @@ files:
81
81
  - lib/error_ready/engine.rb
82
82
  - lib/error_ready/formatter.rb
83
83
  - lib/error_ready/middlewares/rack_middleware.rb
84
+ - lib/error_ready/middlewares/sidekiq_middleware.rb
84
85
  - lib/error_ready/notifiers/async_sender.rb
85
86
  - lib/error_ready/notifiers/sync_sender.rb
86
87
  - lib/error_ready/subscriber.rb