Skip to content

Commit c440f40

Browse files
committed
Throw an exception when incorrect response received
1 parent 03e6026 commit c440f40

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

edge_impulse_linux/runner.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ def send_msg(self, msg):
9999
if (not resp is None):
100100
break
101101

102-
if (not resp or resp["id"] != ix):
102+
if (resp is None):
103+
raise Exception('No data or corrupted data received')
104+
105+
if (resp["id"] != ix):
103106
raise Exception('Wrong id, expected: ' + str(ix) + ' but got ' + resp["id"])
104107

105108
if not resp["success"]:

0 commit comments

Comments
 (0)