denouncer 0.2.4 → 0.2.5
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/denouncer.rb +12 -8
- data/lib/denouncer/version.rb +1 -1
- data/spec/lib/denouncer/denouncer_spec.rb +6 -2
- 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: 18e13628a53f1013de4d104ac8c7f7f7ba322a1d
|
|
4
|
+
data.tar.gz: 6fe0e094e8b9d59dc79026772f34d211a1675417
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4756ec7dcc9fd0aef73d5d5a6afcf2a6cf9f9beab0a4f45aa15674afd321779ce6cdf58b657febcaa5ba18d4d2be25a5792aa1fa30ca63e4e8587bd9a0f7347c
|
|
7
|
+
data.tar.gz: 2a7e48863d3be97aadd69d6c88d9798a2ac953b6fc7306f89640a4252cbf5857b5c7cd93d720845722e0b547606179f57452d8dd97264ba7c230db9ea427c44a
|
data/lib/denouncer.rb
CHANGED
|
@@ -40,14 +40,18 @@ module Denouncer
|
|
|
40
40
|
# @param error [StandardError]
|
|
41
41
|
# @param metadata [Hash]
|
|
42
42
|
def self.notify(error, metadata = nil)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
if is_configured?
|
|
44
|
+
# ATTENTION: this ensures that no exceptions are lost when denouncer is not working as expected!!!
|
|
45
|
+
# This is worth the downside of denouncer debugging thougths.
|
|
46
|
+
begin
|
|
47
|
+
notifier.notify error, metadata
|
|
48
|
+
return true
|
|
49
|
+
rescue => err
|
|
50
|
+
puts "An error occured while sending an exception notification via denouncer!"
|
|
51
|
+
raise error
|
|
52
|
+
end
|
|
53
|
+
else
|
|
54
|
+
return false
|
|
51
55
|
end
|
|
52
56
|
end
|
|
53
57
|
|
data/lib/denouncer/version.rb
CHANGED
|
@@ -147,11 +147,15 @@ describe Denouncer do
|
|
|
147
147
|
expect(notifier).to receive(:notify).with(error, metadata)
|
|
148
148
|
Denouncer.notify error, metadata
|
|
149
149
|
end
|
|
150
|
+
|
|
151
|
+
it "should return true" do
|
|
152
|
+
expect(Denouncer.notify error).to be_truthy
|
|
153
|
+
end
|
|
150
154
|
end
|
|
151
155
|
|
|
152
156
|
context "unconfigured" do
|
|
153
|
-
it "should
|
|
154
|
-
expect
|
|
157
|
+
it "should return false" do
|
|
158
|
+
expect(Denouncer.notify error).to be_falsey
|
|
155
159
|
end
|
|
156
160
|
end
|
|
157
161
|
end
|