Ver código fonte

Fix ecl command line not showing server side compilation errors

Fixes https://github.com/hpcc-systems/LN/issues/417

Signed-off-by: Anthony Fishbeck <Anthony.Fishbeck@lexisnexis.com>
Anthony Fishbeck 13 anos atrás
pai
commit
3344334be7

+ 12 - 5
ecl/eclcmd/eclcmd_core.cpp

@@ -203,12 +203,19 @@ bool doDeploy(EclCmdWithEclTarget &cmd, IClientWsWorkunits *client, const char *
         fprintf(stdout, "\n");
         if (cmd.optVerbose)
             fprintf(stdout, "Deployed\n   wuid: ");
-        if (displayWuid || cmd.optVerbose)
-            fprintf(stdout, "%s\n", w);
         const char *state = resp->getWorkunit().getState();
-        if (cmd.optVerbose)
-            fprintf(stdout, "   state: %s\n", state);
-        return streq(resp->getWorkunit().getState(), state);
+        bool isCompiled = strieq(state, "compiled");
+        if (displayWuid || cmd.optVerbose || !isCompiled)
+            fprintf(stdout, "%s\n", w);
+        if (cmd.optVerbose || !isCompiled)
+            fprintf(stdout, "   state: %s\n\n", state);
+        IArrayOf<IConstECLException> &exceptions = resp->getWorkunit().getExceptions();
+        ForEachItemIn(i, exceptions)
+        {
+            IConstECLException &e = exceptions.item(i);
+            fprintf(stderr, "%s: %s %d: %s\n", e.getSource(), e.getSeverity(), e.getCode(), e.getMessage());
+        }
+        return isCompiled;
     }
     return false;
 }

+ 1 - 0
esp/services/ws_workunits/ws_workunitsService.cpp

@@ -3275,6 +3275,7 @@ void deployArchive(IEspContext &context, IEspWUDeployWorkunitRequest & req, IEsp
 
     WsWuInfo winfo(context, wuid.str());
     winfo.getCommon(resp.updateWorkunit(), WUINFO_All);
+    winfo.getExceptions(resp.updateWorkunit(), WUINFO_All);
 
     AuditSystemAccess(context.queryUserId(), true, "Updated %s", wuid.str());
 }