From 8148f777a4129e525b627dd1e24cee7db1396537 Mon Sep 17 00:00:00 2001 From: Juan P Lopez Date: Tue, 29 Oct 2024 09:42:27 -0500 Subject: [PATCH] fix(core): handle unknown error for unsupported payment feature --- core/api/src/services/lnd/errors.ts | 1 + core/api/src/services/lnd/index.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/core/api/src/services/lnd/errors.ts b/core/api/src/services/lnd/errors.ts index e115c5f641..2062563d5f 100644 --- a/core/api/src/services/lnd/errors.ts +++ b/core/api/src/services/lnd/errors.ts @@ -23,6 +23,7 @@ export const KnownLndErrorDetails = { MissingDependentFeature: /missing dependent feature/, FeaturePairExists: /feature pair exists/, InvoiceAmountTooLarge: /invoice amount .* BTC is too large/, + UnsupportedPaymentFeature: /UnsupportedPaymentFeatureInPayRequest/, // On-chain InsufficientFunds: /insufficient funds available to construct transaction/, diff --git a/core/api/src/services/lnd/index.ts b/core/api/src/services/lnd/index.ts index 1a55ff8b3a..df117af0ee 100644 --- a/core/api/src/services/lnd/index.ts +++ b/core/api/src/services/lnd/index.ts @@ -1208,6 +1208,7 @@ const handleSendPaymentLndErrors = ({ case match(KnownLndErrorDetails.InsufficientBalanceToAttemptPayment): return new InsufficientBalanceForLnPaymentError() case match(KnownLndErrorDetails.FeaturePairExists): + case match(KnownLndErrorDetails.UnsupportedPaymentFeature): return new InvalidFeatureBitsForLndInvoiceError() case match(KnownLndErrorDetails.InsufficientFee): return new InsufficientFeeForLnPaymentError() @@ -1264,6 +1265,7 @@ const handleCommonRouteNotFoundErrors = (err: Error | unknown) => { return new DestinationMissingDependentFeatureError() case match(KnownLndErrorDetails.FeaturePairExists): + case match(KnownLndErrorDetails.UnsupportedPaymentFeature): return new InvalidFeatureBitsForLndInvoiceError() default: