Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception handling not working with Node 9.8 #1312

Closed
mikeandtherest opened this issue May 15, 2018 · 4 comments
Closed

Exception handling not working with Node 9.8 #1312

mikeandtherest opened this issue May 15, 2018 · 4 comments

Comments

@mikeandtherest
Copy link

Please tell us about your environment:

Both Winston@2.4.2 and Winston@3.0.0-rc5

Node 9.8, 10.0, 10.1

Win 10 Pro

Javascript (ES6)

What is the problem?

It seems that with the latest versions of Node (9.8+), the uncaught exceptions are not handled
properly anymore by winston. That is, they are written to file but the exception message and stack
trace is still output to the console, as if the exception was not handled at all.

What do you expect to happen instead?

I tested this on another PC with Node 8.8.1, and there the exceptions are logged to the file
and the console is clean upon exit, as it should.

Other information

If I use also a transport Console for the exception handler, I get it logged to the console properly, but after it I also get the ugly node js uncaught exception message.

Btw, I started with winston@2.4.2 and then I switched to @3.0.0-rc5, but it didn't help since it was the same.

@indexzero
Copy link
Member

Can you upgrade to the latest node@10 and see if this reproduces? We do not officially support non-LTS versions of node ever. node@10 support will be official when it becomes LTS in October, until then we strive to work with the latest node, but do not officially support it.

By that I mean bugs that are node@10 only will be lower priority compared to other bugs, but will 100% be fixed before node@10 goes LTS in October.

@divmgl
Copy link

divmgl commented May 20, 2018

This isn't working with LTS either.

// using Console transport and format simple
const err = new Error('some-error')
log.error(err) // -> error: undefined

@indexzero
Copy link
Member

@mikeandtherest going to close this as a duplicate of #1263. I was able to get that sample working with no issue on node@8 and node@10.

There could be some nuance in the behavior your use cases is exhibiting, but we need a MWE (minimum working example) such as the one provided in #1263 to triage further. Feel free to reopen if you have time to create one.

@indexzero
Copy link
Member

@divmgl the bug you pointed out is tracked as #1338 – please feel free to comment there.

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

No branches or pull requests

3 participants