Skip to content

Commit

Permalink
Merge pull request ZJONSSON#39 from jeffbski/improve-transform-error
Browse files Browse the repository at this point in the history
improve transform error message
  • Loading branch information
ZJONSSON authored Apr 20, 2020
2 parents 2fa6e8b + 71110a4 commit 94f8592
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,14 @@ class ParquetTransformer extends stream.Transform {

_transform(row, encoding, callback) {
if (row) {
this.writer.appendRow(row)
.then(d => callback(null,d), callback);
this.writer.appendRow(row).then(
data => callback(null, data),
err => {
const fullErr = new Error(`Error transforming to parquet: ${err.toString()} row:${JSON.stringify(row)}`);
fullErr.origErr = err;
callback(fullErr);
}
);
} else {
callback();
}
Expand Down

0 comments on commit 94f8592

Please sign in to comment.