Log serial write exceptions to octoprint.log

(cherry picked from commit 367ba06)
This commit is contained in:
Gina Häußge committed 2015-07-07 18:39:54 +02:00
1 parent 19a5613e59
commit a5bf3c3be1
1 file changed
+4 -2
+4 -2
View File
@@ -1638,11 +1638,13 @@ class MachineCom(object):
try:
self._serial.write(cmd + '\n')
except:
self._log("Unexpected error while writing serial port: %s" % (get_exception_string()))
self._logger.exception("Unexpected error while writing to serial port")
self._log("Unexpected error while writing to serial port: %s" % (get_exception_string()))
self._errorValue = get_exception_string()
self.close(True)
except:
self._log("Unexpected error while writing serial port: %s" % (get_exception_string()))
self._logger.exception("Unexpected error while writing to serial port")
self._log("Unexpected error while writing to serial port: %s" % (get_exception_string()))
self._errorValue = get_exception_string()
self.close(True)