File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ class File extends EventEmitter {
3333
3434 open ( ) {
3535 this . _writeStream = new fs . WriteStream ( this . path ) ;
36+ this . _writeStream . on ( 'error' , ( err ) => {
37+ this . emit ( 'error' , err ) ;
38+ } ) ;
3639 }
3740
3841 toJSON ( ) {
Original file line number Diff line number Diff line change @@ -257,7 +257,9 @@ class IncomingForm extends EventEmitter {
257257 type : part . mime ,
258258 hash : this . hash ,
259259 } ) ;
260-
260+ file . on ( 'error' , ( err ) => {
261+ this . _error ( err ) ;
262+ } ) ;
261263 this . emit ( 'fileBegin' , part . name , file ) ;
262264
263265 file . open ( ) ;
@@ -540,6 +542,10 @@ class IncomingForm extends EventEmitter {
540542 type : mime ,
541543 } ) ;
542544
545+ file . on ( 'error' , ( err ) => {
546+ this . _error ( err ) ;
547+ } ) ;
548+
543549 this . emit ( 'fileBegin' , filename , file ) ;
544550 file . open ( ) ;
545551 this . openedFiles . push ( file ) ;
You can’t perform that action at this time.
0 commit comments