mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
refactor: call organizeProofs in a try-catch block
This commit is contained in:
parent
6afa0bb7f1
commit
c344cb6b74
1 changed files with 7 additions and 1 deletions
|
|
@ -332,7 +332,13 @@ route.post('/nutzap', userMiddleware({ enc: 'nip44' }), swapNutzapsMiddleware, a
|
||||||
}
|
}
|
||||||
|
|
||||||
const unspentProofs = await relay.query([{ kinds: [7375], authors: [pubkey] }], { signal });
|
const unspentProofs = await relay.query([{ kinds: [7375], authors: [pubkey] }], { signal });
|
||||||
const organizedProofs = await organizeProofs(unspentProofs, user.signer);
|
let organizedProofs;
|
||||||
|
try {
|
||||||
|
organizedProofs = await organizeProofs(unspentProofs, user.signer);
|
||||||
|
} catch (e) {
|
||||||
|
logi({ level: 'error', ns: 'ditto.api.cashu.nutzap', error: errorJson(e) });
|
||||||
|
return c.json({ error: 'Failed to organize proofs' }, 500);
|
||||||
|
}
|
||||||
|
|
||||||
const proofsToBeUsed: Proof[] = [];
|
const proofsToBeUsed: Proof[] = [];
|
||||||
const eventsToBeDeleted: NostrEvent[] = [];
|
const eventsToBeDeleted: NostrEvent[] = [];
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue