Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1428 ib critical errors #1429

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions sysbrokers/IB/ib_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,18 @@ def __init__(

# You can pass a client id yourself, or let IB find one

self._init_connection(
ipaddress=ipaddress, port=port, client_id=client_id, account=account
)
try:
self._init_connection(
ipaddress=ipaddress, port=port, client_id=client_id, account=account
)
except Exception as e:
# Log all exceptions generated during connection as critical error.
# Under the default production setup this should send an email.
# Error is reraised as we can't really continue and user intervention is required
self.log.critical(
f"IB connection falied with exception - {e}, connection aborted."
)
raise

def _init_connection(
self, ipaddress: str, port: int, client_id: int, account=arg_not_supplied
Expand Down