healtcheck_proxy_client 0.4.0 → 0.5.0

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
2
  SHA256:
3
- metadata.gz: e03484f7f03d8c19e9f0eeb8ca6705a4445db23be964df46f9df1d508229cf04
4
- data.tar.gz: 8ed6ebdfcd536a6582e6dae1ef2c0dd91e94471cc68209d5017b3695c5bb6374
3
+ metadata.gz: a5d44441768291b359ace2629f098ff7ce6b4e0d4e4ff6ba1d236d9ca8415359
4
+ data.tar.gz: 1212c4b7b0bcbb4efe433e5604bc51fe44f3459f0690389e050317dddbee3811
5
5
  SHA512:
6
- metadata.gz: 384a277de59e1c8ff60956e0c63b3f088833c8398824058dba4c3c2b0d9436500a5924f7d2e9f5d3e304b50a72103848709f2e123ad9d847fa49666517169971
7
- data.tar.gz: fe7783e7b3cf6853eab6d6f4d5ba8ab3d65536cc523567045b73cb38f991c131df44f16824e123fa903943259ce76c3d969194fb6e5a298891143610a1a92bc3
6
+ metadata.gz: 69e70b3fb25544b19df1957dcbf21f687f3025d5fe394b1a27d4a24e32cde6b663e94152bdcd74f9581db17f7bee6806591cfe002395eccbe94b71bf66122a42
7
+ data.tar.gz: e606f4ccf10d29ae622ddd23774dcf644a8f5bb2d5c2e52be99ef1d6136772f3a627f592768905f3fc14b2ac0034c19abc4dd1c6c96b77cf136462e657083fe1
@@ -14,7 +14,7 @@ module HealtcheckProxyClient
14
14
  end
15
15
 
16
16
  def ping
17
- Faraday.get(url)
17
+ validate_response(Faraday.get(url))
18
18
  rescue Faraday::Error => e
19
19
  raise HttpError.new(e.message, http_error: e)
20
20
  end
@@ -24,7 +24,15 @@ module HealtcheckProxyClient
24
24
  def_delegators :@configuration, :api_key, :endpoint
25
25
 
26
26
  def url
27
- "#{endpoint}/#{@healthcheck}/ping?token=#{api_key}"
27
+ "#{endpoint}/checks/#{@healthcheck}/ping?token=#{api_key}"
28
+ end
29
+
30
+ def validate_response(response)
31
+ return response if response.status == 200
32
+ raise HttpError.new(
33
+ "Invalid HTTP Status code: #{response.status}",
34
+ http_error: response
35
+ )
28
36
  end
29
37
  end
30
38
  end
@@ -1,3 +1,3 @@
1
1
  module HealtcheckProxyClient
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: healtcheck_proxy_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hendrik Kleinwaechter
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-17 00:00:00.000000000 Z
11
+ date: 2019-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday