Skip to content
This repository was archived by the owner on Feb 3, 2026. It is now read-only.

Commit be606f5

Browse files
committed
[Proxy] handle all aiohttp proxy errors
1 parent c9af332 commit be606f5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

trading_backend/exchanges/exchange.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# License along with this library.
1616
import ccxt
1717
import contextlib
18+
import aiohttp
1819
try:
1920
from aiohttp_socks import ProxyConnectionError
2021
except ImportError:
@@ -207,7 +208,12 @@ def error_describer(self):
207208
"""
208209
try:
209210
yield
210-
except (ccxt.ExchangeNotAvailable, ccxt.AuthenticationError, ProxyConnectionError) as err:
211+
except (
212+
# Generic connection / exchange error
213+
ccxt.ExchangeNotAvailable, ccxt.AuthenticationError, ccxt.ExchangeError,
214+
# Proxy errors
215+
aiohttp.ClientHttpProxyError, aiohttp.ClientProxyConnectionError, ProxyConnectionError
216+
) as err:
211217
try:
212218
self._exchange.connector.raise_or_prefix_proxy_error_if_relevant(err, None)
213219
except ccxt.BaseError:

0 commit comments

Comments
 (0)