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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a526a11a2057f12a278ab4f88ec1a0c03e0cf55f
4
- data.tar.gz: 605e30abe12b000856a0c2e8d1f2fcba6dd99d1a
3
+ metadata.gz: e5e79a23fa11cc3bb82b0823d6a0cc49a91dc435
4
+ data.tar.gz: db6bf436d57107434eaf4c1e8fda5812d4ce518d
5
5
  SHA512:
6
- metadata.gz: 9709a396da2b5e776bfa3e9c8e85fd8b594052f72a6047a4f8c0cb70cd2ddcd9cb40e57540db66741c160be658bc98a691e2d5cf4cdf4d0cdb1e3da5d6d4bc62
7
- data.tar.gz: c2af4080f63fc8ad277552ef163772ec5c0ed69ffc608ff3929d15bcf1a25c5a326ee8b886177bcac99b283bb870be1d0155486015328ff9db32d02464f3d688
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.error(
25
- error,
26
- data
27
- )
23
+ Rollbar.warning("Status: #{response.code} URL: #{request.url}", data)
28
24
  end
29
25
  end
@@ -1,3 +1,3 @@
1
1
  module LHCCoreInterceptors
2
- VERSION = '2.3.1'
2
+ VERSION = '2.3.2'
3
3
  end
@@ -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(:error)
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(:error)
25
- .with(LHC::BadRequest, hash_including(response: anything, request: anything))
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(:error)
38
+ expect(::Rollbar).to have_received(:warning)
35
39
  .with(
36
- LHC::BadRequest,
40
+ 'Status: 400 URL: http://local.ch',
37
41
  hash_including(
38
42
  response: anything,
39
43
  request: anything,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lhc-core-interceptors
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - local.ch