From f8b2237274f0b88e51e31bfde7bb42bc18b6bf4a Mon Sep 17 00:00:00 2001 From: Martin Filser Date: Sat, 2 Apr 2022 11:48:14 +0200 Subject: [PATCH] Better error message layout if Wekan can not start --- server/00checkStartup.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/server/00checkStartup.js b/server/00checkStartup.js index 8315237d3..9589aa586 100644 --- a/server/00checkStartup.js +++ b/server/00checkStartup.js @@ -1,22 +1,23 @@ var fs = require('fs'); -let error = false - +let errors = []; if (!process.env.WRITABLE_PATH) { - console.error("WRITABLE_PATH environment variable missing and/or unset, please configure !"); - error = true; + errors.push("WRITABLE_PATH environment variable missing and/or unset, please configure !"); } else { try { fs.accessSync(process.env.WRITABLE_PATH, fs.constants.W_OK); } catch (err) { - error = true; - console.error("can't write to " + process.env.WRITABLE_PATH, err); - console.error("the path of WRITABLE_PATH (" + process.env.WRITABLE_PATH + ") must be writable !!!"); + errors.push("can't write to " + process.env.WRITABLE_PATH, err); + errors.push("the path of WRITABLE_PATH (" + process.env.WRITABLE_PATH + ") must be writable !!!"); } } -if (error) { +if (errors.length > 0) { + console.error("\n\n"); + console.error(errors.join("\n")); + console.error("\n"); console.error("Stopping Wekan"); - console.error("Wekan isn't runable. Please resolve the error's above and restart Wekan !"); + console.error("Wekan isn't runnable. Please resolve the error's above and restart Wekan !"); + console.error("\n\n"); process.exit(1); }