Commit 20795ffc authored by Gary Hodgson's avatar Gary Hodgson Committed by Guillaume Seguin

distinguish serial exception@

parent c5963dae
...@@ -169,16 +169,16 @@ class printcore(): ...@@ -169,16 +169,16 @@ class printcore():
return line return line
except SelectError as e: except SelectError as e:
if 'Bad file descriptor' in e.args[1]: if 'Bad file descriptor' in e.args[1]:
print "Can't read from printer (disconnected?) ({0}): {1}".format(e.errno, e.strerror) print "Can't read from printer (disconnected?) (SelectError {0}): {1}".format(e.errno, e.strerror)
return None return None
else: else:
print "SelectError ({0}): {1}".format(e.errno, e.strerror) print "SelectError ({0}): {1}".format(e.errno, e.strerror)
raise raise
except SerialException as e: except SerialException as e:
print "Can't read from printer (disconnected?) ({0}): {1}".format(e.errno, e.strerror) print "Can't read from printer (disconnected?) (SerialException {0}): {1}".format(e.errno, e.strerror)
return None return None
except OSError as e: except OSError as e:
print "Can't read from printer (disconnected?) ({0}): {1}".format(e.errno, e.strerror) print "Can't read from printer (disconnected?) (OS Error {0}): {1}".format(e.errno, e.strerror)
return None return None
def _listen_can_continue(self): def _listen_can_continue(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment