Skip to content

Commit 0697b74

Browse files
committed
Catch RequestException inside of zone_status_iterator, and re-raise it as a ServerNotReadyError
1 parent 2cd0d2c commit 0697b74

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

brainframe/api/stubs/zone_statuses.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ def zone_status_iterator():
5858
message = "Incomplete packet while attempting to read " \
5959
"from zone status iterator"
6060
raise bf_errors.ServerNotReadyError(message) from exc
61+
except requests.exceptions.RequestException as exc:
62+
message = "A network exception occurred while " \
63+
"communicating with the BrainFrame server"
64+
new_exc = bf_errors.ServerNotReadyError(message)
65+
new_exc.__cause__ = exc
66+
raise bf_errors.ServerNotReadyError(message)
6167

6268
if packet == b'':
6369
continue

0 commit comments

Comments
 (0)