Skip to content
Snippets Groups Projects
Commit 9817d145 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Catch and print exceptions

Because of the way this script is invoked from str_cmds.js (using js.exec)
any exceptions were just silent failures, making debugging issues
(e.g. the recent regression with the global ascii() function) difficult.
parent de1132e2
No related branches found
No related tags found
No related merge requests found
......@@ -87,6 +87,7 @@ if(!mqtt.subscribe(terminal_topic)) {
}
print("*** Synchronet MQTT Spy on Node " + node_num + ": Ctrl-C to Abort ***\r\n");
try {
while(!js.terminated) {
var msg = mqtt.read(/* timeout: */10, /* verbose: */true);
if(msg) {
......@@ -127,5 +128,8 @@ while(!js.terminated) {
}
}
}
} catch(e) {
print(e);
}
print();
print("Done spying");
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment