Skip to content

Commit

Permalink
fix: attach a catch handler to the handleContentP promise (#250)
Browse files Browse the repository at this point in the history
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.

Fixes #249
  • Loading branch information
kalinkrustev committed Nov 27, 2023
1 parent 1a74bd3 commit 6755c0e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/content/write.js
Expand Up @@ -67,6 +67,7 @@ class CacacheWriteStream extends Flush {
this.cache,
this.opts
)
this.handleContentP.catch(error => this.emit('error', error))
}
return this.inputStream.write(chunk, encoding, cb)
}
Expand Down

0 comments on commit 6755c0e

Please sign in to comment.