From 018f8f316442148f442497147ceeece96afbd68f Mon Sep 17 00:00:00 2001 From: Mohammed Ibrahim Date: Thu, 6 Jun 2024 18:56:20 -0400 Subject: [PATCH] Render deployment result as strings (#2894) --- .../functionActivator/deployment/DeploymentResult.java | 10 ++++++++++ .../deployment/SnowflakeDeploymentResult.java | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/legend-engine-xts-functionActivator/legend-engine-xt-functionActivator-protocol/src/main/java/org/finos/legend/engine/protocol/functionActivator/deployment/DeploymentResult.java b/legend-engine-xts-functionActivator/legend-engine-xt-functionActivator-protocol/src/main/java/org/finos/legend/engine/protocol/functionActivator/deployment/DeploymentResult.java index c6b6fa25b2c..315b0d3bf75 100644 --- a/legend-engine-xts-functionActivator/legend-engine-xt-functionActivator-protocol/src/main/java/org/finos/legend/engine/protocol/functionActivator/deployment/DeploymentResult.java +++ b/legend-engine-xts-functionActivator/legend-engine-xt-functionActivator-protocol/src/main/java/org/finos/legend/engine/protocol/functionActivator/deployment/DeploymentResult.java @@ -19,4 +19,14 @@ public class DeploymentResult public String activatorIdentifier; public boolean successful; public String deploymentLocation; + + @Override + public String toString() + { + if (!successful) + { + return "Deployment failed."; + } + return "Deployment Successful. Location: " + deploymentLocation; + } } diff --git a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-api/src/main/java/org/finos/legend/engine/language/snowflakeApp/deployment/SnowflakeDeploymentResult.java b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-api/src/main/java/org/finos/legend/engine/language/snowflakeApp/deployment/SnowflakeDeploymentResult.java index e8fe931d241..07f7a7be9e1 100644 --- a/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-api/src/main/java/org/finos/legend/engine/language/snowflakeApp/deployment/SnowflakeDeploymentResult.java +++ b/legend-engine-xts-snowflakeApp/legend-engine-xt-snowflakeApp-api/src/main/java/org/finos/legend/engine/language/snowflakeApp/deployment/SnowflakeDeploymentResult.java @@ -33,4 +33,14 @@ public SnowflakeDeploymentResult(MutableList errors) { this.errors = errors; } + + @Override + public String toString() + { + if (!successful) + { + return "Deployment failed. Reason(s): " + this.errors.makeString("[", ",", "]"); + } + return super.toString(); + } }