From 2e1383d1e399211e3bb5bc1363fde2535bd78782 Mon Sep 17 00:00:00 2001 From: Kalin Krustev Date: Wed, 22 Nov 2023 14:03:55 +0100 Subject: [PATCH] fix #249 This attaches a catch handler to the handleContentP promise, as in some cases the flush is not called before node decides that this is an unhandled promise rejection. --- lib/content/write.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/content/write.js b/lib/content/write.js index 7146146..2884dbb 100644 --- a/lib/content/write.js +++ b/lib/content/write.js @@ -67,6 +67,7 @@ class CacacheWriteStream extends Flush { this.cache, this.opts ) + this.handleContentP.catch(error => this.destroy(error)) } return this.inputStream.write(chunk, encoding, cb) }