catch errors in multiple places that might be destroying the async flow and causing lnbits to die silently.

This commit is contained in:
fiatjaf
2021-04-10 17:37:48 -03:00
parent b48a44bcd0
commit fdf4f6c1ae
9 changed files with 82 additions and 55 deletions
+2 -2
View File
@@ -49,7 +49,7 @@ class SparkWallet(Wallet):
timeout=40,
)
except (OSError, httpx.ConnectError, httpx.RequestError) as exc:
raise SparkError("error connecting to spark: " + str(exc))
raise UnknownError("error connecting to spark: " + str(exc))
try:
data = r.json()
@@ -123,7 +123,7 @@ class SparkWallet(Wallet):
payment_hash = pay["payment_hash"]
if len(pays) > 1:
raise Exception(
raise SparkError(
f"listpays({payment_hash}) returned an unexpected response: {listpays}"
)