Skip to content

Commit 7fb3c09

Browse files
committed
Added more exception handling to protocol tests
1 parent 08b9a0a commit 7fb3c09

File tree

1 file changed

+11
-6
lines changed
  • src/instrumentman/protocoltest

1 file changed

+11
-6
lines changed

src/instrumentman/protocoltest/app.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,16 @@ def main(
198198
retry=retry,
199199
sync_after_timeout=sync_after_timeout
200200
) as com:
201-
if protocol == "geocom":
202-
tps = GeoCom(com)
203-
tests_geocom(tps)
204-
elif protocol == "gsidna":
205-
dna = GsiOnlineDNA(com)
206-
tests_gsidna(dna)
201+
try:
202+
if protocol == "geocom":
203+
tps = GeoCom(com)
204+
tests_geocom(tps)
205+
elif protocol == "gsidna":
206+
dna = GsiOnlineDNA(com)
207+
tests_gsidna(dna)
208+
except Exception as e:
209+
echo_red("An exception occured while running the tests")
210+
echo_red(e)
211+
207212
except (SerialException, ConnectionError) as e:
208213
echo_red(f"Connection was not successful ({e})")

0 commit comments

Comments
 (0)