mirror of
https://github.com/Routstr/routstrd.git
synced 2026-10-05 20:38:22 +00:00
Merge pull request #29 from Routstr/fix/not-enough-proofs-balance-error
fix: surface cocod "Not enough proofs" as InsufficientBalanceError
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { getDecodedToken } from "@cashu/cashu-ts";
|
||||
import { InsufficientBalanceError } from "@routstr/sdk";
|
||||
import { logger } from "../../utils/logger";
|
||||
import { createCocodClient, type CocodClient } from "./cocod-client";
|
||||
|
||||
@@ -79,6 +80,10 @@ export async function createWalletAdapter(
|
||||
continue;
|
||||
}
|
||||
|
||||
if (errorMessage.includes("Not enough proofs")) {
|
||||
throw new InsufficientBalanceError(amount, 0);
|
||||
}
|
||||
|
||||
logger.error("Error in walletAdapter sendToken:", error);
|
||||
throw error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user