From 3e75d9604e8fa88180cfef9e722c12639eb2fb6e Mon Sep 17 00:00:00 2001 From: Ziggy Jonsson Date: Wed, 7 Feb 2018 16:43:03 -0500 Subject: [PATCH] Also ensure errors in `this.writer.close` that are not sent to the callback are captured subsequently and included in the callback. --- lib/writer.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/writer.js b/lib/writer.js index 0f50aa3d..0c2f2c83 100644 --- a/lib/writer.js +++ b/lib/writer.js @@ -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); } }