mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-04 13:09:41 +00:00
fix(logger): log promise in unhandledRejection event
This commit is contained in:
parent
e1f9643ffd
commit
6c4e1a326f
1 changed files with 3 additions and 2 deletions
|
|
@ -84,8 +84,9 @@ let loggerInterface = {
|
|||
|
||||
// Logs unhandled promises errors
|
||||
// when no catch is attached to a promise a unhandledRejection event will be triggered
|
||||
process.on('unhandledRejection', function handlePromiseRejection (reason) {
|
||||
loggerInterface.error('unhandledPromiseRejection', reason);
|
||||
// reason is the error, p the promise where it originated
|
||||
process.on('unhandledRejection', function handlePromiseRejection (reason, p) {
|
||||
loggerInterface.error(reason, 'unhandledPromiseRejection at', p);
|
||||
});
|
||||
|
||||
module.exports = loggerInterface;
|
||||
|
|
|
|||
Loading…
Reference in a new issue