forked from ChrisChrome/weather-bot
Update error handling in index.js
This commit is contained in:
parent
bcdda75a77
commit
b4f4f4b017
2
index.js
2
index.js
|
@ -1171,7 +1171,7 @@ process.on("unhandledRejection", (error, promise) => {
|
|||
fs.mkdirSync("./error");
|
||||
}
|
||||
// write ./error/rejection_timestamp.txt
|
||||
fs.writeFileSync(`./error/rejection_${Date.now()}.txt`, `ERROR:\n${error}\n\nPROMISE:\n${promise}`);
|
||||
fs.writeFileSync(`./error/rejection_${Date.now()}.txt`, `ERROR:\n${error}\n\nPROMISE:\n${JSON.stringify(promise)}`);
|
||||
return;
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue