lhc-core-interceptors 2.3.1 → 2.3.2
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/lhc-core-interceptors/rollbar.rb +1 -5
- data/lib/lhc-core-interceptors/version.rb +1 -1
- data/spec/rollbar/main_spec.rb +9 -5
- 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: e5e79a23fa11cc3bb82b0823d6a0cc49a91dc435
|
4
|
+
data.tar.gz: db6bf436d57107434eaf4c1e8fda5812d4ce518d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 161e10142c2b3aafdf74280cf95436a5a39b2c8690c9e0eaeaf121668f75ff165ab1c8af2e9d3906852f5ec0930aa0b3745d78934d779a55c87031c643e2c5c0
|
7
|
+
data.tar.gz: a9df8890b2a03b64040058a33f92ba1bc1e1e7cd542231a9857b0068822f8e902e42bce94189fc06189c2447263617e5b3e7bcbc116c9b9fafcbd037faa005f7
|
@@ -5,7 +5,6 @@ class LHC::Rollbar < LHC::Interceptor
|
|
5
5
|
return unless Object.const_defined?('Rollbar')
|
6
6
|
request = response.request
|
7
7
|
additional_params = request.options.fetch(:rollbar, {})
|
8
|
-
error = LHC::Error.find(response)
|
9
8
|
data = {
|
10
9
|
response: {
|
11
10
|
body: response.body,
|
@@ -21,9 +20,6 @@ class LHC::Rollbar < LHC::Interceptor
|
|
21
20
|
params: request.params
|
22
21
|
}
|
23
22
|
}.merge additional_params
|
24
|
-
Rollbar.
|
25
|
-
error,
|
26
|
-
data
|
27
|
-
)
|
23
|
+
Rollbar.warning("Status: #{response.code} URL: #{request.url}", data)
|
28
24
|
end
|
29
25
|
end
|
data/spec/rollbar/main_spec.rb
CHANGED
@@ -14,15 +14,19 @@ describe LHC::Rollbar do
|
|
14
14
|
context 'Rollbar is defined' do
|
15
15
|
before(:each) do
|
16
16
|
class Rollbar; end
|
17
|
-
allow(::Rollbar).to receive(:
|
17
|
+
allow(::Rollbar).to receive(:warning)
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'does report errors to rollbar' do
|
21
21
|
stub_request(:get, 'http://local.ch').to_return(status: 400)
|
22
22
|
expect(-> { LHC.get('http://local.ch') })
|
23
23
|
.to raise_error LHC::BadRequest
|
24
|
-
expect(::Rollbar).to have_received(:
|
25
|
-
.with(
|
24
|
+
expect(::Rollbar).to have_received(:warning)
|
25
|
+
.with(
|
26
|
+
'Status: 400 URL: http://local.ch',
|
27
|
+
response: hash_including(body: anything, code: anything, headers: anything, time: anything, timeout?: anything),
|
28
|
+
request: hash_including(url: anything, method: anything, headers: anything, params: anything)
|
29
|
+
)
|
26
30
|
end
|
27
31
|
|
28
32
|
context 'additional params' do
|
@@ -31,9 +35,9 @@ describe LHC::Rollbar do
|
|
31
35
|
.to_return(status: 400)
|
32
36
|
expect(-> { LHC.get('http://local.ch', rollbar: { additional: 'data' }) })
|
33
37
|
.to raise_error LHC::BadRequest
|
34
|
-
expect(::Rollbar).to have_received(:
|
38
|
+
expect(::Rollbar).to have_received(:warning)
|
35
39
|
.with(
|
36
|
-
|
40
|
+
'Status: 400 URL: http://local.ch',
|
37
41
|
hash_including(
|
38
42
|
response: anything,
|
39
43
|
request: anything,
|