Skip to content

Commit b22f394

Browse files
committed
Improve error messaging for creating a Deployment that will violate quotas with high max-in-flight
Fix Rubocop error
1 parent aa44c5d commit b22f394

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

app/actions/deployment_create.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,12 @@ def handle_deployment_create_error(e, app)
9090
space_quota_errors = [:space_quota_exceeded.to_s, :space_app_instance_limit_exceeded.to_s]
9191
org_quota_errors = [:quota_exceeded.to_s, :app_instance_limit_exceeded.to_s]
9292
if space_quota_errors.any? { |substring| e.message.include?(substring) }
93-
error_msg = " for space #{app.space.name}. This space's quota may not be large enough to support rolling deployments or your configured max-in-flight."
94-
error = DeploymentCreate::Error.new(e.message + error_msg)
93+
space_error_msg = " for space #{app.space.name}. This space's quota may not be large enough to support rolling deployments or your configured max-in-flight."
94+
error = DeploymentCreate::Error.new(e.message + space_error_msg)
9595
elsif org_quota_errors.any? { |substring| e.message.include?(substring) }
96-
error_msg = " for organization #{app.organization.name}. This organization's quota may not be large enough to support rolling deployments or your configured max-in-flight."
97-
error = DeploymentCreate::Error.new(e.message + error_msg)
96+
org_error_msg_1 = " for organization #{app.organization.name}. "
97+
org_error_msg_2 = "This organization's quota may not be large enough to support rolling deployments or your configured max-in-flight."
98+
error = DeploymentCreate::Error.new(e.message + org_error_msg_1 + org_error_msg_2)
9899
else
99100
error = DeploymentCreate::Error.new(e.message)
100101
end

0 commit comments

Comments
 (0)