How to failfast with pipe when using plantuml in cli

0 votes
asked Apr 16, 2022 in Question / help by anonymous

Hi,

I am trying to run plantuml to generate diagrams in my nodejs application. My script looks like this:

  const cmd = `java -jar "${JAR_PATH}" -failfast2 -pipe > "${imageOutputPath}"`;

  const childProcess = exec(cmd);

  childProcess.stdin.write(

    content,

    (e) => {

      if (e) {

        logger.debug(e);

      }

      childProcess.stdin.end();

    },

  );

Because I don't have Graphviz installed, I am expecting the execution to fail fast and not generate any diagram, but it still generates a diagram with the error that Graphviz is not found. I also tried `-noerror` and it does not seem to work as expected(diagrams are still generated). This is tested against v1.2020.17 and the latest release (I know the latest version includes Graphviz by default but I found it to be flaky, i.e. sometimes it still generates error diagrams, which I don't want).

I am not sure what went wrong and would like to ask if there is a right way to skip generating diagrams when there is an error.

Thank you in advance!

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...