summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java4
-rw-r--r--vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java9
2 files changed, 11 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);
diff --git a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java
index db4d7a4c522..210151c450d 100644
--- a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java
+++ b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/DeployMojo.java
@@ -37,6 +37,15 @@ public class DeployMojo extends AbstractVespaDeploymentMojo {
@Override
protected void doExecute() throws MojoFailureException, MojoExecutionException {
+ try {
+ controller.compileVersion(id);
+ }
+ catch (IllegalArgumentException e) {
+ throw new MojoFailureException( "The application " + id.tenant() + "." + id.application() + " does not exist, "
+ + "or you do not have the required privileges to access it; "
+ + "please visit the Vespa cloud web UI and make sure the application exists and you have access!");
+ }
+
loggable = DeploymentLog.Level.valueOf(vespaLogLevel);
Deployment deployment = Deployment.ofPackage(Paths.get(firstNonBlank(applicationZip,
projectPathOf("target", "application.zip"))));