Change error handling to show in web log

This commit is contained in:
Skylar Grant 2023-01-06 17:23:03 -05:00
parent 85bf00a35a
commit 72f814b016

View File

@ -236,7 +236,7 @@ switch (process.env.ONPI) {
console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] I: ${res}`); console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] I: ${res}`);
main(gpio); main(gpio);
}).catch(rej => { }).catch(rej => {
console.error(`[${(Date.now() - config.timestamps.procStart)/1000}] E: Error during initialization: ${rej}`); console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] E: Error during initialization: ${rej}`);
process.exit(1); process.exit(1);
}); });
break; break;
@ -247,12 +247,12 @@ switch (process.env.ONPI) {
console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] I: ${res}`); console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] I: ${res}`);
main(gpio); main(gpio);
}).catch(rej => { }).catch(rej => {
console.error(`[${(Date.now() - config.timestamps.procStart)/1000}] E: Error during initialization: ${rej}`); console.log(`[${(Date.now() - config.timestamps.procStart)/1000}] E: Error during initialization: ${rej}`);
process.exit(1); process.exit(1);
}); });
break; break;
default: default:
console.error(`[${Date.now() - config.timestamps.procStart}] E: Problem with ENV file.`); console.log(`[${Date.now() - config.timestamps.procStart}] E: Problem with ENV file.`);
process.exit(1); process.exit(1);
break; break;
} }