Skip to content

Commit

Permalink
throw error during data parsing (#513)
Browse files Browse the repository at this point in the history
Co-authored-by: xifeiwu <wuxifei@finupgroup.com>
Co-authored-by: Charlike Mike Reagent <opensource@tunnckocore.com>
  • Loading branch information
3 people committed Nov 28, 2019
1 parent 5c5d1d0 commit c8bba1b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/incoming_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ IncomingForm.prototype.parse = function(req, cb) {
self._error(new Error('Request aborted'));
})
.on('data', function(buffer) {
self.write(buffer);
try {
self.write(buffer);
} catch (err) {
self._error(err);
}
})
.on('end', function() {
if (self.error) {
Expand Down

0 comments on commit c8bba1b

Please sign in to comment.