Skip to content

Commit a2a6e41

Browse files
committed
[Coinbase] handle proxy error when loading markets
1 parent c7438ea commit a2a6e41

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

Trading/Exchange/coinbase/coinbase_exchange.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,20 @@ async def _ensure_auth(self):
268268
# replace self.exchange_manager.exchange.get_balance by get_open_orders
269269
# to mitigate coinbase balance cache side effect
270270
await self.exchange_manager.exchange.get_open_orders(symbol="BTC/USDC")
271-
except (octobot_trading.errors.AuthenticationError, ccxt.AuthenticationError):
271+
except (
272+
octobot_trading.errors.AuthenticationError,
273+
octobot_trading.errors.ExchangeProxyError,
274+
ccxt.AuthenticationError
275+
):
272276
# this error is critical on coinbase as it prevents loading markets: propagate it
273-
raise
274-
except Exception as e:
277+
raise
278+
except Exception as err:
279+
if self.force_authentication:
280+
raise
275281
# Is probably handled in exchange tentacles, important thing here is that authentication worked
276-
self.logger.debug(f"Error when checking exchange connection: {e}. This should not be an issue.")
282+
self.logger.warning(
283+
f"Error when checking exchange connection: {err} ({err.__class__.__name__}). This should not be an issue."
284+
)
277285

278286

279287
class Coinbase(exchanges.RestExchange):

0 commit comments

Comments
 (0)