geekier_factory 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -72,12 +72,12 @@ module GeekierFactory
72
72
  ConnectionException = Class.new(Exception)
73
73
  def handle_response!(response)
74
74
  if error_responses.map{ |er| er['code'] }.include? response.status
75
- ex = @structure['errorResponses'].select{ |er| er['code'] == response.status }
76
- if ex['retry'] == true && (@retries ||= 0) < ex['retry']
75
+ ex = error_responses.find{ |er| er['code'] == response.status }
76
+ if ex.has_key?('retry') && (@retries ||= 0) < ex['retry'].to_i
77
77
  @retries += 1
78
78
  raise Retry.new
79
79
  else
80
- message = "#{ex[:reason]} (HTTP status code #{ex[:code]})"
80
+ message = "#{ex['reason']} (HTTP status code #{ex['code']})"
81
81
  message = message + "\n\n" + response[:body] if ex['details'] && ex['details'] == 'body'
82
82
  raise ConnectionException.new(message)
83
83
  end
@@ -1,3 +1,3 @@
1
1
  module GeekierFactory
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geekier_factory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: