Skip to content

Conversation

@Vitaha
Copy link
Contributor

@Vitaha Vitaha commented Dec 19, 2017

When fileMaxSize reached _error() calls _writeStream.destroy() which turns into unhandled exception.

When fileMaxSize reached _error() calls _writeStream.destroy() which turns into unhandled exception.
@kornelski
Copy link
Contributor

Thanks for the PR. Should it report error to the caller? e.g. cb(Error())?

@Vitaha
Copy link
Contributor Author

Vitaha commented Dec 22, 2017

I rechecked code and found, that such error can be received if we call _error method direct from onFileBegin or onProgress events (request triggers 'data' event on part, but file already destroyed). I didn't find any other scenarios that could cause this error (I didn't check octet-stream).
In any case, when _error was called anywhere, then error property is already set on the incoming form object and we can silently ignore destroyed file usage.

@kornelski kornelski merged commit 6041695 into node-formidable:master Dec 22, 2017
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