mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 09:47:50 -06:00
Added exception handling for serial write
This commit is contained in:
parent
2765122b95
commit
49a9561625
1 changed files with 3 additions and 0 deletions
|
@ -226,6 +226,9 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
|
||||||
except SerialTimeoutException:
|
except SerialTimeoutException:
|
||||||
Logger.log("w", "Timeout when sending command to printer via USB.")
|
Logger.log("w", "Timeout when sending command to printer via USB.")
|
||||||
self._command_received.set()
|
self._command_received.set()
|
||||||
|
except SerialException:
|
||||||
|
Logger.logException("w", "An unexpected exception occurred while writing to the serial.")
|
||||||
|
self.setConnectionState(ConnectionState.Error)
|
||||||
|
|
||||||
def _update(self):
|
def _update(self):
|
||||||
while self._connection_state == ConnectionState.Connected and self._serial is not None:
|
while self._connection_state == ConnectionState.Connected and self._serial is not None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue