Skip to content

Conversation

@alexandre-abrioux
Copy link
Contributor

@alexandre-abrioux alexandre-abrioux commented Oct 28, 2021

Winston cannot handle promise rejections if the rejected object is undefined.
A simple test is to add Promise.reject(undefined) somewhere in your app and Winston will throw the following exception:

TypeError: Cannot destructure property 'message' of 'err' as it is undefined.
    at RejectionHandler.getAllInfo (/.../node_modules/winston/lib/winston/rejection-handler.js:77:11)
    at RejectionHandler._unhandledRejection (/.../node_modules/winston/lib/winston/rejection-handler.js:168:23)

I added a test that checks for this error, and a fix that makes this test go green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants