aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/payments.ts12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/payments.ts b/lib/payments.ts
index 5984a813..cf6a344f 100644
--- a/lib/payments.ts
+++ b/lib/payments.ts
@@ -1111,7 +1111,17 @@ const getAddressType = async (a) => {
try {
await lq.getAddressInfo(a);
return PaymentType.liquid;
- } catch (e) {
+ } catch (e: any) {
+ // Distinguish "lq is down" from "address isn't liquid" so users get a
+ // useful message instead of "unrecognized address" when cs/lq is the
+ // actual problem.
+ if (
+ e?.message?.includes("Unable to connect") ||
+ e?.code === "ECONNREFUSED" ||
+ e?.code === "ETIMEDOUT"
+ ) {
+ fail("liquid temporarily unavailable");
+ }
fail("unrecognized address");
}
}