frontend: prefer to catch SerialException
It's a subclass of IOError, which we were catching first.
This commit is contained in:
parent
d318384c25
commit
3a81844a17
@ -139,11 +139,6 @@ class StcGal:
|
|||||||
else:
|
else:
|
||||||
self.protocol.disconnect()
|
self.protocol.disconnect()
|
||||||
return 0
|
return 0
|
||||||
except IOError as e:
|
|
||||||
sys.stdout.flush();
|
|
||||||
print("I/O error: %s" % e, file=sys.stderr)
|
|
||||||
self.protocol.disconnect()
|
|
||||||
return 1
|
|
||||||
except NameError as e:
|
except NameError as e:
|
||||||
sys.stdout.flush();
|
sys.stdout.flush();
|
||||||
print("Option error: %s" % e, file=sys.stderr)
|
print("Option error: %s" % e, file=sys.stderr)
|
||||||
@ -162,6 +157,11 @@ class StcGal:
|
|||||||
except serial.SerialException as e:
|
except serial.SerialException as e:
|
||||||
print("Serial port error: %s" % e, file=sys.stderr)
|
print("Serial port error: %s" % e, file=sys.stderr)
|
||||||
return 1
|
return 1
|
||||||
|
except IOError as e:
|
||||||
|
sys.stdout.flush();
|
||||||
|
print("I/O error: %s" % e, file=sys.stderr)
|
||||||
|
self.protocol.disconnect()
|
||||||
|
return 1
|
||||||
|
|
||||||
|
|
||||||
def cli():
|
def cli():
|
||||||
|
Loading…
Reference in New Issue
Block a user