geekier_factory 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/geekier_factory/action.rb +5 -1
- data/lib/geekier_factory/version.rb +1 -1
- metadata +1 -1
@@ -63,11 +63,15 @@ module GeekierFactory
|
|
63
63
|
rescue Retry => e
|
64
64
|
retry
|
65
65
|
end
|
66
|
+
|
67
|
+
def error_responses
|
68
|
+
(@structure['errorResponses'] || []) + @api.error_responses
|
69
|
+
end
|
66
70
|
|
67
71
|
Retry = Class.new(Exception)
|
68
72
|
ConnectionException = Class.new(Exception)
|
69
73
|
def handle_response!(response)
|
70
|
-
if
|
74
|
+
if error_responses.map{ |er| er['code'] }.include? response.status
|
71
75
|
ex = @structure['errorResponses'].select{ |er| er['code'] == response.status }
|
72
76
|
if ex['retry'] == true && (@retries ||= 0) < ex['retry']
|
73
77
|
@retries += 1
|