Skip to content

Commit

Permalink
Merge pull request #1429 from vishalg/bug_1428_ib_critical_errors
Browse files Browse the repository at this point in the history
Bug 1428 ib critical errors
  • Loading branch information
bug-or-feature authored Oct 26, 2024
2 parents 80aecf2 + abf2c48 commit 4d89b98
Showing 1 changed file with 12 additions and 3 deletions.
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

0 comments on commit 4d89b98

Please sign in to comment.