Skip to content

Commit

Permalink
fix is_test_drive optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Graeme22 committed Jan 6, 2025
1 parent 5c379fe commit 1176cd5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tastytrade/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ class Account(TastytradeJsonDataclass):
is_firm_error: bool
is_firm_proprietary: bool
is_futures_approved: bool
is_test_drive: bool
is_test_drive: bool = False
margin_or_cash: str
is_foreign: bool
created_at: datetime
Expand Down
5 changes: 5 additions & 0 deletions tastytrade/streamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,11 @@ async def _connect(self) -> None:
logger.error(f"Streamer error: {message}")
except ConnectionClosed as e:
logger.error(f"Websocket connection closed with {e}")
if e.rcvd and e.rcvd.code == 1009:
logger.error(
"Subscription message too long! Try reducing the number of symbols."
)
return
except asyncio.CancelledError:
logger.debug("Websocket interrupted, cancelling main loop.")
return
Expand Down

0 comments on commit 1176cd5

Please sign in to comment.