Skip to content

Commit

Permalink
Also ensure errors in this.writer.close that are not sent to the ca…
Browse files Browse the repository at this point in the history
…llback are captured subsequently and included in the callback.
  • Loading branch information
ZJONSSON committed Feb 18, 2018
1 parent 7ea27d3 commit 3e75d96
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,15 @@ class ParquetTransformer extends stream.Transform {
_transform(row, encoding, callback) {
if (row) {
this.writer.appendRow(row)
.then(callback)
.catch(e => callback(e));
.then(d => callback(null,d), callback);
} else {
callback();
}
}

_flush(callback) {
this.writer.close(callback);
this.writer.close(callback)
.then(d => callback(null, d), callback);
}

}
Expand Down

0 comments on commit 3e75d96

Please sign in to comment.