spaceship/lib/spaceship/test_flight/client.rb in fastlane-2.36.0 vs spaceship/lib/spaceship/test_flight/client.rb in fastlane-2.37.0.beta.20170601010043
- old
+ new
@@ -25,15 +25,16 @@
response = request(:get, "providers/#{team_id}/apps/#{app_id}/platforms/#{platform}/trains")
handle_response(response)
end
- def get_builds_for_train(app_id: nil, platform: "ios", train_version: nil)
+ def get_builds_for_train(app_id: nil, platform: "ios", train_version: nil, retry_count: 0)
assert_required_params(__method__, binding)
-
- response = request(:get, "providers/#{team_id}/apps/#{app_id}/platforms/#{platform}/trains/#{train_version}/builds")
- handle_response(response)
+ with_retry(retry_count: retry_count) do
+ response = request(:get, "providers/#{team_id}/apps/#{app_id}/platforms/#{platform}/trains/#{train_version}/builds")
+ handle_response(response)
+ end
end
##
# @!group Builds API
##
@@ -187,9 +188,11 @@
def handle_response(response)
if (200...300).cover?(response.status) && (response.body.nil? || response.body.empty?)
return
end
+
+ raise InternalServerError, "Server error got #{response.status}" if (500...600).cover?(response.status)
unless response.body.kind_of?(Hash)
raise UnexpectedResponse, response.body
end