frontend: catch unknown errors

Catch unknown error types in the first stage (connect/initialize).
Sometimes we unfortunately see unexpected exceptions, for instance
pyserial might throw termios.error. See #39 for more details.
This commit is contained in:
Grigori Goronzy 2018-09-24 00:39:31 +02:00
parent 97d0d1123b
commit bc829ce54c

View File

@ -182,6 +182,10 @@ class StcGal:
sys.stdout.flush()
print("I/O error: %s" % ex, file=sys.stderr)
return 1
except Exception as ex:
sys.stdout.flush()
print("Unexpected error: %s" % ex, file=sys.stderr)
return 1
try:
if self.opts.code_image: