Commit 06de65d7 authored by Guillaume Seguin's avatar Guillaume Seguin

Explicitely handle IOErrors in printcore.connect (#446)

parent ff8e57df
...@@ -192,6 +192,11 @@ class printcore(): ...@@ -192,6 +192,11 @@ class printcore():
"\n" + _("Serial error: %s") % e) "\n" + _("Serial error: %s") % e)
self.printer = None self.printer = None
return return
except IOError as e:
self.logError(_("Could not connect to %s at baudrate %s:") % (self.port, self.baud) +
"\n" + _("IO error: %s") % e)
self.printer = None
return
self.stop_read_thread = False self.stop_read_thread = False
self.read_thread = Thread(target = self._listen) self.read_thread = Thread(target = self._listen)
self.read_thread.start() self.read_thread.start()
......
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