aboutsummaryrefslogtreecommitdiffstats
path: root/controller-api
diff options
context:
space:
mode:
authorHarald Musum <musum@yahooinc.com>2023-05-22 13:33:56 +0200
committerHarald Musum <musum@yahooinc.com>2023-05-22 13:33:56 +0200
commitf872038482382aef5f329954a9815469c48f4538 (patch)
treea9d90086d0435bd856f5fa217d5502c3f5f21263 /controller-api
parentbeddb01f9c8c3f9c34ef110cd38a0a666834102b (diff)
Handle quota exceeded from config server
Diffstat (limited to 'controller-api')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServerException.java20
1 files changed, 2 insertions, 18 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServerException.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServerException.java
index 2b35334e14b..7b5166dc84e 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServerException.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServerException.java
@@ -1,13 +1,6 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.api.integration.configserver;
-import com.yahoo.slime.Inspector;
-import com.yahoo.slime.SlimeUtils;
-
-import java.util.stream.Stream;
-
-import static java.nio.charset.StandardCharsets.UTF_8;
-
/**
* An exception due to server error, a bad request, or similar.
*
@@ -49,17 +42,8 @@ public class ConfigServerException extends RuntimeException {
CERTIFICATE_NOT_READY,
LOAD_BALANCER_NOT_READY,
INCOMPLETE_RESPONSE,
- CONFIG_NOT_CONVERGED
- }
-
- public static ConfigServerException readException(byte[] body, String context) {
- Inspector root = SlimeUtils.jsonToSlime(body).get();
- String codeName = root.field("error-code").asString();
- ErrorCode code = Stream.of(ErrorCode.values())
- .filter(value -> value.name().equals(codeName))
- .findAny().orElse(ErrorCode.INCOMPLETE_RESPONSE);
- String message = root.field("message").valid() ? root.field("message").asString() : new String(body, UTF_8);
- return new ConfigServerException(code, message, context);
+ CONFIG_NOT_CONVERGED,
+ QUOTA_EXCEEDED
}
}