Propagate errors in signers

This commit is contained in:
Jon Staab
2025-09-22 11:41:21 -07:00
parent beadfc571c
commit 728140c77c
2 changed files with 3 additions and 5 deletions
+2 -4
View File
@@ -1,3 +1,4 @@
import {noop} from "@welshman/lib"
import {StampedEvent} from "@welshman/util"
import {
hash,
@@ -31,10 +32,7 @@ export class Nip07Signer implements ISigner {
})
// Recover from errors
this.#lock = promise.then(
() => undefined,
() => undefined,
)
this.#lock = promise.then(noop).catch(noop)
return promise
}
+1 -1
View File
@@ -109,6 +109,6 @@ export const signWithOptions = (
options: SignOptions,
) =>
new Promise<SignedEvent>((resolve, reject) => {
Promise.resolve(promise).then(resolve)
Promise.resolve(promise).then(resolve).catch(reject)
options.signal?.addEventListener("abort", () => reject("Signing was aborted"))
})