Browse Source
bip70 payreq: catch TimeoutError to avoid hanging "please wait" dialog
related #5337
dependabot/pip/contrib/deterministic-build/ecdsa-0.13.3
SomberNight
6 years ago
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
1 changed files with
3 additions and
4 deletions
-
electrum/paymentrequest.py
|
|
@ -25,12 +25,11 @@ |
|
|
|
import hashlib |
|
|
|
import sys |
|
|
|
import time |
|
|
|
import traceback |
|
|
|
import json |
|
|
|
from typing import Optional |
|
|
|
import asyncio |
|
|
|
import urllib.parse |
|
|
|
|
|
|
|
import certifi |
|
|
|
import urllib.parse |
|
|
|
import aiohttp |
|
|
|
|
|
|
|
|
|
|
@ -87,7 +86,7 @@ async def get_payment_request(url: str) -> 'PaymentRequest': |
|
|
|
data = resp_content |
|
|
|
data_len = len(data) if data is not None else None |
|
|
|
_logger.info(f'fetched payment request {url} {data_len}') |
|
|
|
except aiohttp.ClientError as e: |
|
|
|
except (aiohttp.ClientError, asyncio.TimeoutError) as e: |
|
|
|
error = f"Error while contacting payment URL: {url}.\nerror type: {type(e)}" |
|
|
|
if isinstance(e, aiohttp.ClientResponseError): |
|
|
|
error += f"\nGot HTTP status code {e.status}." |
|
|
|