diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2019-10-11 09:47:30 +0200 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2019-10-11 09:47:30 +0200 |
commit | 1e95910431b64e2c0653c5a1a2f0be5e40141544 (patch) | |
tree | 79866b6129365ab85fc39a54f0256c3ffd4a34e2 /hosted-api | |
parent | 28913b4f7dc9597966c6e93f1a77af923549eea2 (diff) |
Direct user to console when application does not exist or is forbidden
Diffstat (limited to 'hosted-api')
-rw-r--r-- | hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java b/hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java index 6a339c41034..1947930285c 100644 --- a/hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java +++ b/hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java @@ -230,8 +230,8 @@ public abstract class ControllerHttpClient { Inspector rootObject = toSlime(response.body()).get(); String message = response.request() + " returned code " + response.statusCode() + - " (" + rootObject.field("error-code").asString() + "): " + - rootObject.field("message").asString(); + (rootObject.field("error-code").valid() ? " (" + rootObject.field("error-code").asString() + ")" : "") + + ": " + rootObject.field("message").asString(); if (response.statusCode() / 100 == 4) throw new IllegalArgumentException(message); |