Handle another kind of exception

This commit is contained in:
Mark Veidemanis 2022-02-17 15:15:15 +00:00
parent d9f55ce497
commit a46f6ed3f3
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ from twisted.internet.threads import deferToThread
from json import loads from json import loads
from forex_python.converter import CurrencyRates from forex_python.converter import CurrencyRates
from agoradesk_py import AgoraDesk from agoradesk_py import AgoraDesk
from httpx import ReadTimeout, ReadError from httpx import ReadTimeout, ReadError, RemoteProtocolError
from pycoingecko import CoinGeckoAPI from pycoingecko import CoinGeckoAPI
from datetime import datetime from datetime import datetime
from time import sleep from time import sleep
@ -25,7 +25,7 @@ def handle_exceptions(func):
def inner_function(*args, **kwargs): def inner_function(*args, **kwargs):
try: try:
rtrn = func(*args, **kwargs) rtrn = func(*args, **kwargs)
except (ReadTimeout, ReadError): except (ReadTimeout, ReadError, RemoteProtocolError):
return False return False
if isinstance(rtrn, dict): if isinstance(rtrn, dict):
if "success" in rtrn: if "success" in rtrn: