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 {
33
33
34
34
open ( ) {
35
35
this . _writeStream = new fs . WriteStream ( this . path ) ;
36
+ this . _writeStream . on ( 'error' , ( err ) => {
37
+ this . emit ( 'error' , err ) ;
38
+ } ) ;
36
39
}
37
40
38
41
toJSON ( ) {
Original file line number Diff line number Diff line change @@ -257,7 +257,9 @@ class IncomingForm extends EventEmitter {
257
257
type : part . mime ,
258
258
hash : this . hash ,
259
259
} ) ;
260
-
260
+ file . on ( 'error' , ( err ) => {
261
+ this . _error ( err ) ;
262
+ } ) ;
261
263
this . emit ( 'fileBegin' , part . name , file ) ;
262
264
263
265
file . open ( ) ;
@@ -540,6 +542,10 @@ class IncomingForm extends EventEmitter {
540
542
type : mime ,
541
543
} ) ;
542
544
545
+ file . on ( 'error' , ( err ) => {
546
+ this . _error ( err ) ;
547
+ } ) ;
548
+
543
549
this . emit ( 'fileBegin' , filename , file ) ;
544
550
file . open ( ) ;
545
551
this . openedFiles . push ( file ) ;
You can’t perform that action at this time.
0 commit comments