Skip to content

Commit e279875

Browse files
committed
docs: add @MunMunMiao as a contributor
1 parent 11b1feb commit e279875

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/File.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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() {

src/Formidable.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)