airbrake 5.8.0 → 5.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/airbrake/rack/middleware.rb +5 -4
- data/lib/airbrake/version.rb +1 -1
- data/spec/unit/rack/middleware_spec.rb +8 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ad6d5f1f3dbd4190b70472b3109bd24c70b25884
|
|
4
|
+
data.tar.gz: b3af8d47bf1f2f79f0d624ea8726c482bc31ea71
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 60754321fb09cb14b563d65d77a42a6df481c3530107a6cb127d83782fe01b883dd0cbbfa832f004672c8c04ecabe6dfe9449ee3d0e2fb7e7d3881d04607fc3b
|
|
7
|
+
data.tar.gz: 4b6433d157646f90229817032c50a252f7fef3ea3b9e6a28b931debe4eebb070dee0537c77e93a2828e0b9dd1afa9a1da3ee1acedbdc898dac9a758c078b7d6a
|
|
@@ -30,14 +30,15 @@ module Airbrake
|
|
|
30
30
|
|
|
31
31
|
def initialize(app, notifier_name = :default)
|
|
32
32
|
@app = app
|
|
33
|
-
@
|
|
33
|
+
@notifier = Airbrake[notifier_name]
|
|
34
34
|
|
|
35
35
|
# Prevent adding same filters to the same notifier.
|
|
36
36
|
return if @@known_notifiers.include?(notifier_name)
|
|
37
37
|
@@known_notifiers << notifier_name
|
|
38
38
|
|
|
39
|
+
return unless @notifier
|
|
39
40
|
RACK_FILTERS.each do |filter|
|
|
40
|
-
|
|
41
|
+
@notifier.add_filter(filter.new)
|
|
41
42
|
end
|
|
42
43
|
end
|
|
43
44
|
|
|
@@ -64,11 +65,11 @@ module Airbrake
|
|
|
64
65
|
private
|
|
65
66
|
|
|
66
67
|
def notify_airbrake(exception, env)
|
|
67
|
-
notice =
|
|
68
|
+
notice = @notifier.build_notice(exception)
|
|
68
69
|
return unless notice
|
|
69
70
|
|
|
70
71
|
notice.stash[:rack_request] = ::Rack::Request.new(env)
|
|
71
|
-
|
|
72
|
+
@notifier.notify(notice)
|
|
72
73
|
end
|
|
73
74
|
|
|
74
75
|
##
|
data/lib/airbrake/version.rb
CHANGED
|
@@ -27,6 +27,14 @@ RSpec.describe Airbrake::Rack::Middleware do
|
|
|
27
27
|
stub_request(:post, endpoint).to_return(status: 201, body: '{}')
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
+
describe "#new" do
|
|
31
|
+
it "doesn't add filters if no notifiers are configured" do
|
|
32
|
+
expect do
|
|
33
|
+
expect(described_class.new(faulty_app, :unknown_notifier))
|
|
34
|
+
end.not_to raise_error
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
30
38
|
describe "#call" do
|
|
31
39
|
context "when app raises an exception" do
|
|
32
40
|
context "and when the notifier name is specified" do
|