Don't display error stack when not needed, and if needed check it exist

before trying to display it.
This commit is contained in:
Godzil
2018-06-26 21:51:51 +01:00
parent c2e9449630
commit 3ac1f4ee9e
2 changed files with 10 additions and 3 deletions

View File

@@ -26,7 +26,14 @@ batch(process.argv, (err: any) =>
{
if (err)
{
console.error(err.stack || err);
if (err.stack)
{
console.error(err.stack || err);
}
else
{
console.error(err);
}
process.exit(-1);
}
console.info('Done!');