-
Notifications
You must be signed in to change notification settings - Fork 6
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
Error: stream.push() after EOF #16
Comments
I deployed the try/catch and it seems to have addressed the problem: https://github.com/jotto/streaming-cache/commit/aa9f63c27889d6cbcb62f46d627fc11de110bb6e |
@jotto, thanks for your work on this and sorry for the late reply. I would suggest using 'uncaughtException' in your code. 'unhandledRejection' is only used for promises. The following might help as well. Errors are not automatically forwarded in a stream.
|
Will close this issue. A new version has been pushed to NPM. |
Explanation
I'm intermittently getting these
stream.push
errors on an HTTP server, which seem to terminate the Node process, even with aprocess.on("unhandledRejection")
. I assume the error is happening because the HTTP client is disconnecting before the stream finishes, but why can't I seem to capture these errors and/or prevent Node from terminating?Possible solution?
Could it be as simple as adding try/catch around the
.push
call in readStream?streaming-cache/lib/readStream.js
Line 40 in 90121ff
Error message/stack
Note, the line numbers in this stack trace are a little off because I'm using the forked code from #14
Code looks like:
The text was updated successfully, but these errors were encountered: