mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
Better error message layout if Wekan can not start
This commit is contained in:
parent
84d94079cc
commit
f8b2237274
1 changed files with 10 additions and 9 deletions
|
@ -1,22 +1,23 @@
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
|
||||||
let error = false
|
let errors = [];
|
||||||
|
|
||||||
if (!process.env.WRITABLE_PATH) {
|
if (!process.env.WRITABLE_PATH) {
|
||||||
console.error("WRITABLE_PATH environment variable missing and/or unset, please configure !");
|
errors.push("WRITABLE_PATH environment variable missing and/or unset, please configure !");
|
||||||
error = true;
|
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
fs.accessSync(process.env.WRITABLE_PATH, fs.constants.W_OK);
|
fs.accessSync(process.env.WRITABLE_PATH, fs.constants.W_OK);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
error = true;
|
errors.push("can't write to " + process.env.WRITABLE_PATH, err);
|
||||||
console.error("can't write to " + process.env.WRITABLE_PATH, err);
|
errors.push("the path of WRITABLE_PATH (" + process.env.WRITABLE_PATH + ") must be writable !!!");
|
||||||
console.error("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("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);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue