Handle another kind of exception
This commit is contained in:
parent
d9f55ce497
commit
a46f6ed3f3
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue