fix(logger): only two arguments to logger when logging an unhandled promise rejection

This commit is contained in:
Matteo Pagliazzi 2020-03-26 17:10:19 +01:00
parent 4300c7b1bf
commit 2fc4d0f00c

View file

@ -207,8 +207,8 @@ const loggerInterface = {
// Logs unhandled promises errors
// when no catch is attached to a promise a unhandledRejection event will be triggered
// reason is the error, p the promise where it originated
process.on('unhandledRejection', (reason, p) => {
loggerInterface.error(reason, 'unhandledPromiseRejection at', p);
process.on('unhandledRejection', (reason, promise) => {
loggerInterface.error(reason, { message: 'unhandledPromiseRejection', promise });
});
export default loggerInterface;