mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
Don't crash if USB device is taken over by other applications or breaks
If it happens at just the wrong moment, Cura could crash. Hopefully no longer, though I fear that now it would maybe crash somewhere else with the same error then. We'll find out through new error reports, I hope. Fixes Sentry issue CURA-K8.
This commit is contained in:
parent
971d8cd8e2
commit
29d2e5c921
1 changed files with 4 additions and 1 deletions
|
@ -191,7 +191,10 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
|||
try:
|
||||
self._serial = Serial(str(self._serial_port), self._baud_rate, timeout=self._timeout, writeTimeout=self._timeout)
|
||||
except SerialException:
|
||||
Logger.log("w", "An exception occurred while trying to create serial connection")
|
||||
Logger.warning("An exception occurred while trying to create serial connection.")
|
||||
return
|
||||
except OSError as e:
|
||||
Logger.warning("The serial device is suddenly unavailable while trying to create a serial connection: {err}".format(err = str(e)))
|
||||
return
|
||||
CuraApplication.getInstance().globalContainerStackChanged.connect(self._onGlobalContainerStackChanged)
|
||||
self._onGlobalContainerStackChanged()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue