From 652bdf9e42c4a50adc85dae020d5e9157e498a43 Mon Sep 17 00:00:00 2001 From: tmorin Date: Wed, 8 Jul 2020 13:51:19 +0200 Subject: [PATCH] fix: gdiag should not failed when plantuml.jar fails --- bin/gdiag.js | 2 +- test/test.sh | 1 + test/wd2/empty.puml | 0 3 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 test/wd2/empty.puml diff --git a/bin/gdiag.js b/bin/gdiag.js index b31e9588de0..dd951d36464 100755 --- a/bin/gdiag.js +++ b/bin/gdiag.js @@ -68,7 +68,7 @@ const javaCmd = argv.j; async function plantuml(file) { await exec(`${javaCmd} -jar ${techDir}/plantuml.jar ${file}`, { stdio: process.stdout - }); + }).catch(error => log.warn(error.message)); } async function download(url, destination) { diff --git a/test/test.sh b/test/test.sh index 64d5ecf6441..b58a8066118 100755 --- a/test/test.sh +++ b/test/test.sh @@ -11,6 +11,7 @@ GREP "parse directory \[test\]" GREP "process source \[wd1/src1.puml\]" GREP "process source \[wd1/src2.puml\]" GREP "process source \[wd2/src1.puml\]" +GREP "warn: Command failed: java -jar .gdiag/plantuml.jar test/wd2/empty.puml" RUNS stat test/wd1/src1-diag1.png RUNS stat test/wd1/src2-diag1.png diff --git a/test/wd2/empty.puml b/test/wd2/empty.puml new file mode 100644 index 00000000000..e69de29bb2d