diff --git a/lib/async.ts b/lib/async.ts index 3de0ecc3d3aa3e20c3fb875bd528c6fcfb9ae47c..5e2db72f289589763c025c50b773c2565e95750c 100644 --- a/lib/async.ts +++ b/lib/async.ts @@ -152,7 +152,7 @@ export class DedupeConcurrent { if (promise) return promise; promise = this.fn(...args); this.pending.set(k, promise); - void promise.finally(() => void this.pending.delete(k)); + void promise.finally(() => void this.pending.delete(k)).catch(() => {}); return promise; }; } diff --git a/lib/readme.changes.md b/lib/readme.changes.md index 3c0e85870bd91041a506b18994c479d96c726fb0..38752a0ef130eb0f3d1153c5ed94c38d8c82a753 100644 --- a/lib/readme.changes.md +++ b/lib/readme.changes.md @@ -10,6 +10,11 @@ - finally fixes resize corruptions for long running widgets - `string/ansi`: add `inverse`, `resetInverse`, and `cursorHome`. +### fixes + +- `async.DedupeConcurrent` no longer causes unhandled rejections with correct + caller error handling. + ## v7 ### features diff --git a/lib/repl.ts b/lib/repl.ts index 55b50fe3a931ba7037df5eed6acb33bca3f66c11..acd7b71400005870cc7cc3e97d809241647ae89c 100644 --- a/lib/repl.ts +++ b/lib/repl.ts @@ -18,8 +18,6 @@ * // ... * }, * }, - * - * // many more options to customize how it displays * }); * * import * as repl from "@clo/lib/repl";