Skip to content

Commit

Permalink
improve errorhandling for lndrest #252 (#1631)
Browse files Browse the repository at this point in the history
  • Loading branch information
dni committed Apr 17, 2023
1 parent d82118d commit 156a19f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lnbits/wallets/lndrest.py
Expand Up @@ -58,8 +58,9 @@ async def status(self) -> StatusResponse:
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()
Expand Down

0 comments on commit 156a19f

Please sign in to comment.