go_api_client 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- go_api_client (0.5.0)
4
+ go_api_client (0.5.1)
5
5
  nokogiri
6
6
 
7
7
  GEM
@@ -4,7 +4,10 @@ require 'net/https'
4
4
  module GoApiClient
5
5
  class HttpFetcher
6
6
 
7
- class HttpError < StandardError
7
+ class ConnectionError <StandardError
8
+ end
9
+
10
+ class HttpError < ConnectionError
8
11
  attr_reader :http_code
9
12
  def initialize(msg, http_code)
10
13
  super(msg)
@@ -12,9 +15,6 @@ module GoApiClient
12
15
  end
13
16
  end
14
17
 
15
- class ConnectionError <StandardError
16
- end
17
-
18
18
  NET_HTTP_EXCEPTIONS = [
19
19
  EOFError,
20
20
  Errno::ECONNABORTED,
@@ -48,12 +48,12 @@ module GoApiClient
48
48
  class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
49
49
  def #{meth}!(url, options={})
50
50
  response_body = #{meth}(url, options)
51
- return response_body
52
51
  if failure?
53
52
  message = "Could not fetch url \#{url}."
54
53
  GoApiClient.logger.error("\#{message} The response returned status \#{status} with body `\#{response_body}'")
55
54
  raise HttpError.new(message, status)
56
55
  end
56
+ return response_body
57
57
  rescue *NET_HTTP_EXCEPTIONS => e
58
58
  message = "Could not connect to url \#{url}."
59
59
  GoApiClient.logger.error("\#{message}. The error was \#{e.message}")
@@ -2,7 +2,7 @@ module GoApiClient
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 5
5
- PATCH = 0
5
+ PATCH = 1
6
6
  RELEASE = ENV['GO_PIPELINE_COUNTER']
7
7
  VERSION = [MAJOR, MINOR, PATCH, RELEASE].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: go_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: