aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/send
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-01-25 10:42:34 -0800
committerAdam Soltys <[email protected]>2025-01-25 10:42:34 -0800
commit51246a479363093553975b38eb87e09c436b3a69 (patch)
treee887fa9c1b1f97865c34037d76d54936c265e933 /src/routes/(app)/send
parent1cb3ae54e1fcb09078b40aad581019a31e9fb719 (diff)
downloadcoinos-ui-51246a479363093553975b38eb87e09c436b3a69.tar.gz
coinos-ui-51246a479363093553975b38eb87e09c436b3a69.zip
preserve insufficient funds message
Diffstat (limited to 'src/routes/(app)/send')
-rw-r--r--src/routes/(app)/send/lightning/[payreq]/+page.server.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/routes/(app)/send/lightning/[payreq]/+page.server.ts b/src/routes/(app)/send/lightning/[payreq]/+page.server.ts
index 3c3a4756..0f7b4003 100644
--- a/src/routes/(app)/send/lightning/[payreq]/+page.server.ts
+++ b/src/routes/(app)/send/lightning/[payreq]/+page.server.ts
@@ -38,8 +38,10 @@ export const actions = {
const body = await fd(request);
p = await post("/payments", body, auth(cookies));
- } catch (_) {
- return fail(400, { message: "payments.failedToRoute" });
+ } catch (e) {
+ let { message } = e as Error;
+ if (!message.includes("Insufficient")) message = "payments.failedToRoute";
+ return fail(400, { message });
}
redirect(307, `/sent/${p.id}`);