also catch httpx.ConnectError whenever we do catch httpx.RequestError.
This commit is contained in:
parent
bc2207ba27
commit
69063190ab
1 changed files with 2 additions and 2 deletions
|
|
@ -85,7 +85,7 @@ async def api_payments_create_invoice():
|
|||
lnurl_response = resp["reason"]
|
||||
else:
|
||||
lnurl_response = True
|
||||
except httpx.RequestError:
|
||||
except (httpx.ConnectError, httpx.RequestError):
|
||||
lnurl_response = False
|
||||
|
||||
return (
|
||||
|
|
@ -151,7 +151,7 @@ async def api_payments_pay_lnurl():
|
|||
r = httpx.get(g.data["callback"], params={"amount": g.data["amount"]}, timeout=20)
|
||||
if r.is_error:
|
||||
return jsonify({"message": "failed to connect"}), HTTPStatus.BAD_REQUEST
|
||||
except httpx.RequestError:
|
||||
except (httpx.ConnectError, httpx.RequestError):
|
||||
return jsonify({"message": "failed to connect"}), HTTPStatus.BAD_REQUEST
|
||||
|
||||
params = json.loads(r.text)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue