./lib/shenzhen/plugins/deploygate.rb in shenzhen-0.14.0 vs ./lib/shenzhen/plugins/deploygate.rb in shenzhen-0.14.1
- old
+ new
@@ -76,14 +76,13 @@
parameters[:visibility] = @visibility if @visibility
parameters[:replace] = "true" if options.replace
client = Shenzhen::Plugins::DeployGate::Client.new(@api_token, @user_name)
response = client.upload_build(@file, parameters)
- case response.status
- when 200...300
+ if (200...300) === response.status and not response.body["error"]
say_ok "Build successfully uploaded to DeployGate"
else
- say_error "Error uploading to DeployGate: #{response.body}" and abort
+ say_error "Error uploading to DeployGate: #{response.body["error"] || "(Unknown Error)"}" and abort
end
end
private