-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Make it easier to debug unhandled error events #3270
Comments
Pull requests welcome. Better error messages would be good but it depends on how it's implemented. |
Ok, will try. Can you tell me what's the easiest way to make changes in the Because running all tests take more than one minute but I only want to work on a small piece. |
You always have to rebuild after making changes to files in lib/ and src/. To check only that one test, run The test runner accepts wildcards, by the way. |
@bnoordhuis Got it, thanks. But one thing is weird. I added some debugging information such as
How can I make the output visible within the test execution? |
I'm also seeing a similar error when trying to access mongodb with mongoose. What is the reason for this? And even more important: How to prevent node from crashing? I already catch all errors (try.. catch) and the server still crashes... :-( |
@binarykitchen Run the test standalone: |
@akreienbring |
@bnoordhuis Ok, I've got an idea and have tested it successfully. In if (!this._handle) {
this._destroy(new Error('This socket is closed. Unable to write data ' + data.toString(encoding)), cb);
return false;
} Then in
What's missing is a small function to limit Anyway, I believe that revealing the first 10 chars of data can help developers to locate the socket issue. Let me know your thoughts and I ll produce a concrete PR. |
|
@bnoordhuis Right, I am aware of that. Igniting a discussion here to collect best ideas. Give me some time. @Others Suggestions welcome |
Is there any way to wait for the buffer to have finished before running this._destroy or would that defeat the purpose entirely? Any way promises could be of use here? |
This conversation seems to have run its course. I'm going to close it. Feel free to re-open, comment here, or open a new issue if this is still something worth discussing more. |
We all hard-working developer fear this infamous error:
They are a pain to investigate. Can we make it somehow easier to debug those?
For example unhandled error events coming from sockets could at least include a better error message saying what kind of socket it is. And what listeners are attached to it. That would help enormously.
The text was updated successfully, but these errors were encountered: