From 156a19f05c8b287a09071950df7a2ce7f443dc40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Mon, 17 Apr 2023 09:26:37 +0200 Subject: [PATCH] improve errorhandling for lndrest #252 (#1631) --- lnbits/wallets/lndrest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lnbits/wallets/lndrest.py b/lnbits/wallets/lndrest.py index 303b48796..de8aa1dd2 100644 --- a/lnbits/wallets/lndrest.py +++ b/lnbits/wallets/lndrest.py @@ -58,8 +58,9 @@ class LndRestWallet(Wallet): r = await client.get( f"{self.endpoint}/v1/balance/channels", headers=self.auth ) - except (httpx.ConnectError, httpx.RequestError): - return StatusResponse(f"Unable to connect to {self.endpoint}.", 0) + r.raise_for_status() + except (httpx.ConnectError, httpx.RequestError) as exc: + return StatusResponse(f"Unable to connect to {self.endpoint}. {exc}", 0) try: data = r.json()