diff options
author | Jon Bratseth <bratseth@gmail.com> | 2022-11-20 23:21:47 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2022-11-20 23:21:47 +0100 |
commit | 68a155ce12ea8a7c9051d939b817e8ecab299a53 (patch) | |
tree | ee45a1c9456936372fbd5dddfdef6a9bafb9989a /config-model/src/main/java | |
parent | b693d572df945b9e82798e0c40b8b7b565f6a4a8 (diff) |
Nicer deploy errors
Diffstat (limited to 'config-model/src/main/java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/vespa/model/application/validation/QuotaValidator.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/QuotaValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/QuotaValidator.java index 7ea582b99e6..da470f804d9 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/QuotaValidator.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/QuotaValidator.java @@ -86,19 +86,19 @@ public class QuotaValidator extends Validator { private static void throwIfBudgetNegative(double spend, BigDecimal budget, SystemName systemName) { if (budget.doubleValue() < 0) { - throw new IllegalArgumentException(quotaMessage("Please free up some capacity", systemName, spend, budget)); + throw new IllegalArgumentException(quotaMessage("Please free up some capacity.", systemName, spend, budget)); } } private static void throwIfBudgetExceeded(double spend, BigDecimal budget, SystemName systemName) { if (budget.doubleValue() < spend) { - throw new IllegalArgumentException(quotaMessage("Deployment exceeds its quota and has been blocked! Please contact support to update your plan", systemName, spend, budget)); + throw new IllegalArgumentException(quotaMessage("Contact support to upgrade your plan.", systemName, spend, budget)); } } private static String quotaMessage(String message, SystemName system, double spend, BigDecimal budget) { - String quotaDescription = String.format(Locale.ENGLISH, "Quota is $%.2f, but at least $%.2f is required", budget, spend); - return (system == SystemName.Public ? "" : system.value() + ": ") + message + ": " + quotaDescription; + String quotaDescription = String.format(Locale.ENGLISH, "The max resources specified cost $%.2f but your quota is $%.2f", spend, budget); + return (system == SystemName.Public ? "" : system.value() + ": ") + quotaDescription + ": " + message; } } |