error_ready 0.1.2 → 0.2.3

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: 1e90f8389acb8f9a4e9779fe63efb2c309122728f81e22c50e39442473c7ea07
4
- data.tar.gz: 625c141100d154184fec324588b2d18eefda838d87d2b1abb5645969cc1edf20
3
+ metadata.gz: eec274abaffdc18e9ed91fca54f00a3417cb631a8efcf967a96050f70b7d6990
4
+ data.tar.gz: 31e5f664cb84e78c586bca7fb4059f85e5273e7b562dfa2270ce7493522cf6a2
5
5
  SHA512:
6
- metadata.gz: 4e1054614f11a5b695482511fe73dcc905673f2e9c405a2b081a2256711526db81b420d189a85611a93faa4067485e805e9c42a70f84318f227453579b874640
7
- data.tar.gz: c993186bf5697f498401411d49f0f03f3aa355fa06fd0de8f7102339687aca2a22b9511d0e39d2e2f097cf19d2f3354bcb324b2cb48c904a22e7c37b83f8c4a4
6
+ metadata.gz: 6def060bb3573c179ecd12877ef6a37292157a77248ef07a1a6131be4b6fb45b731a8ba20a264b42252189b7f65589112d76e443bfeb84543ae6b5d0d01d1716
7
+ data.tar.gz: a36de926398cd777d95d9a176c8e4677e991ddbcdd91d697def169c84f22f3da01bc7332c1fb3eb73f838a86637c876602711bc1a0e3f76c29dd21148261a246
@@ -5,5 +5,6 @@ module ErrorReady
5
5
  config_accessor :host, default: "https://errorready.com/api/problems"
6
6
  config_accessor :database_notifier, default: false
7
7
  config_accessor :app_secret
8
+ config_accessor :ignored_environments, default: ["development", "test"]
8
9
  end
9
10
  end
@@ -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
@@ -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
@@ -10,6 +10,8 @@ module ErrorReady
10
10
  ).format
11
11
 
12
12
  # send Async
13
+ return if ErrorReady.configuration.ignored_environments.include?(Rails.env)
14
+
13
15
  AsyncSender.new(formatted_error).call
14
16
  end
15
17
  end
@@ -1,3 +1,3 @@
1
1
  module ErrorReady
2
- VERSION = "0.1.2"
2
+ VERSION = "0.2.3"
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.2
4
+ version: 0.2.3
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-24 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