Fixed
This commit is contained in:
@@ -43,6 +43,12 @@ async def set_switch_position_mode(tg_id: int, symbol: str, mode: int) -> str |
|
||||
tg_id,
|
||||
)
|
||||
return "You have an existing position, so position mode cannot be switched"
|
||||
if str(e).startswith("Open orders exist, so you cannot change position mode"):
|
||||
logger.debug(
|
||||
"Open orders exist, so you cannot change position mode for user: %s",
|
||||
tg_id,
|
||||
)
|
||||
return "Open orders exist, so you cannot change position mode"
|
||||
else:
|
||||
logger.error("Error connecting to Bybit for user %s: %s", tg_id, e)
|
||||
return False
|
||||
|
Reference in New Issue
Block a user