routemaster-drain 3.6.7 → 3.6.8

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
- SHA256:
3
- metadata.gz: c4469f5d849b4e194fab122200d8ad3b674b0614192c8d772c93d5632bc9d7c7
4
- data.tar.gz: 1dcc2036e9718877e22c3af4f2dce9605ae28d851173ede745b3e6dbcd2b4b75
2
+ SHA1:
3
+ metadata.gz: 431caa4e0158fa1ac795d6feeaa81b96c8e2fe4e
4
+ data.tar.gz: cceb454d55e593655e39131e7f127a7592101368
5
5
  SHA512:
6
- metadata.gz: cbac86db4c0502ac01f77e1b4daeb1559dfe7d5edb795a25891ddd7cf0cf7bc948f475349c89a98a4727e1dcacf26bffd36b4d0928a4e9384a0b74482adecc8e
7
- data.tar.gz: 8df8cf287f7fadd4183946e217cbb79247bf875139ff29ae03b3b8951a2b68270c58caf263da5a7dc0847eb4bdb88ed2248fb5b3fd4c41d66a71e03deb90822e
6
+ metadata.gz: f6b4be9f06e085159e29bf2b53bbf171acb04fece4f740482cb28915545788ef77bd94290d85e024fac0b96d1183c5e54e95a0a27ba6496725ea06e119d6c127
7
+ data.tar.gz: 677d45ad6541d7301132e90f2e9516131d2c0559ddda86c61b9c2c4270a405202974f26096030fe082019331e3ce786767d64aa6f7d13d5a34b9a30745e8c2dd
data/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  ### HEAD
2
2
 
3
3
  _A description of your awesome changes here!_
4
+
5
+ ### 3.6.8
6
+
7
+ Features:
8
+
9
+ - Raises error on `502 Bad Gateway` [#94](https://github.com/deliveroo/routemaster-drain/pull/94)
10
+
4
11
  ### 3.6.7 (2021-02-11)
5
12
 
6
13
  Features:
@@ -1,5 +1,5 @@
1
1
  module Routemaster
2
2
  module Drain
3
- VERSION = '3.6.7'.freeze
3
+ VERSION = '3.6.8'.freeze
4
4
  end
5
5
  end
@@ -82,6 +82,12 @@ module Routemaster
82
82
  end
83
83
  end
84
84
 
85
+ class BadGateway < BaseError
86
+ def message
87
+ "Bad Gateway"
88
+ end
89
+ end
90
+
85
91
  class ServiceNotAvailable < BaseError
86
92
  def message
87
93
  "Service Not Available"
@@ -16,6 +16,7 @@ module Routemaster
16
16
  (413..413) => Errors::InvalidResource,
17
17
  (429..429) => Errors::ResourceThrottling,
18
18
  (407..500) => Errors::FatalResource,
19
+ (502..502) => Errors::BadGateway,
19
20
  (503..503) => Errors::ServiceNotAvailable
20
21
  }.freeze
21
22
 
@@ -21,7 +21,7 @@ describe Routemaster::APIClient do
21
21
  let(:port) { 8080 }
22
22
  let(:service) do
23
23
  TestServer.new(port) do |server|
24
- [400, 401, 403, 404, 405, 409, 412, 413, 429, 500, 503].each do |status_code|
24
+ [400, 401, 403, 404, 405, 409, 412, 413, 429, 500, 502, 503].each do |status_code|
25
25
  server.mount_proc "/#{status_code}" do |req, res|
26
26
  res.status = status_code
27
27
  res.body = { field: 'test' }.to_json
@@ -163,6 +163,10 @@ describe Routemaster::APIClient do
163
163
  expect { perform.(host + '/500') }.to raise_error(Routemaster::Errors::FatalResource)
164
164
  end
165
165
 
166
+ it 'raises a BadGateway on 502' do
167
+ expect { perform.(host + '/502') }.to raise_error(Routemaster::Errors::BadGateway)
168
+ end
169
+
166
170
  it 'raises a ServiceNotAvailable on 503' do
167
171
  expect { perform.(host + '/503') }.to raise_error(Routemaster::Errors::ServiceNotAvailable)
168
172
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: routemaster-drain
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.7
4
+ version: 3.6.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien Letessier
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-12 00:00:00.000000000 Z
11
+ date: 2021-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -164,7 +164,7 @@ dependencies:
164
164
  - - '='
165
165
  - !ruby/object:Gem::Version
166
166
  version: 1.0.0
167
- description:
167
+ description:
168
168
  email:
169
169
  - julien.letessier@gmail.com
170
170
  executables: []
@@ -285,7 +285,7 @@ homepage: http://github.com/deliveroo/routemaster-drain
285
285
  licenses:
286
286
  - MIT
287
287
  metadata: {}
288
- post_install_message:
288
+ post_install_message:
289
289
  rdoc_options: []
290
290
  require_paths:
291
291
  - lib
@@ -300,8 +300,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
300
300
  - !ruby/object:Gem::Version
301
301
  version: '0'
302
302
  requirements: []
303
- rubygems_version: 3.0.9
304
- signing_key:
303
+ rubyforge_project:
304
+ rubygems_version: 2.6.11
305
+ signing_key:
305
306
  specification_version: 4
306
307
  summary: Event receiver for the Routemaster bus
307
308
  test_files: