summaryrefslogtreecommitdiffstats
path: root/controller-api
diff options
context:
space:
mode:
authorØyvind Grønnesby <oyving@verizonmedia.com>2020-01-16 12:47:34 +0100
committerGitHub <noreply@github.com>2020-01-16 12:47:34 +0100
commit4ea823be19b67fcf76a8c66d6a1c295f66c5620e (patch)
tree7ec7e81259682f06407c1cd75241b08a930cc390 /controller-api
parentda4d428fe674978239d816e4da768e592c188dbc (diff)
parent97e5473c53f12fd21e8ae94bf6b5628d54bf052b (diff)
Merge pull request #11808 from vespa-engine/hakonhall/improve-deploy-messages
Improve deploy messages
Diffstat (limited to 'controller-api')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServerException.java15
1 files changed, 11 insertions, 4 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 780969206a2..4240b0d9fa6 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
@@ -2,6 +2,7 @@
package com.yahoo.vespa.hosted.controller.api.integration.configserver;
import java.net.URI;
+import java.util.Objects;
/**
* @author Tony Vaagenes
@@ -10,11 +11,13 @@ public class ConfigServerException extends RuntimeException {
private final URI serverUri;
private final ErrorCode errorCode;
+ private final String serverMessage;
- public ConfigServerException(URI serverUri, String message, ErrorCode errorCode, Throwable cause) {
- super(message, cause);
- this.serverUri = serverUri;
- this.errorCode = errorCode;
+ public ConfigServerException(URI serverUri, String context, String serverMessage, ErrorCode errorCode, Throwable cause) {
+ super(context + ": " + serverMessage, cause);
+ this.serverUri = Objects.requireNonNull(serverUri);
+ this.errorCode = Objects.requireNonNull(errorCode);
+ this.serverMessage = Objects.requireNonNull(serverMessage);
}
public ErrorCode getErrorCode() {
@@ -25,6 +28,10 @@ public class ConfigServerException extends RuntimeException {
return serverUri;
}
+ public String getServerMessage() {
+ return serverMessage;
+ }
+
// TODO: Copied from Vespa. Expose these in Vespa and use them here
public enum ErrorCode {
APPLICATION_LOCK_FAILURE,