Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime van Kessel <nallath@gmail.com>2017-09-01 15:43:12 +0300
committerJaime van Kessel <nallath@gmail.com>2017-09-01 15:43:12 +0300
commitbe1b5cd83a11a67563baaa3f294f1a0887c61411 (patch)
treed458f0f308d2d9c8e49271c93dae65831645ed7b /plugins/RemovableDriveOutputDevice
parent98795d8953f8c21613d067f4943b872f02c32319 (diff)
Cura no longer crashes when writing to full SD drive.
It instead tells warns the user and logs the event. CURA-3909
Diffstat (limited to 'plugins/RemovableDriveOutputDevice')
-rw-r--r--plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py b/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py
index f7adef9a3f..80b2a2a430 100644
--- a/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py
+++ b/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py
@@ -123,8 +123,17 @@ class RemovableDriveOutputDevice(OutputDevice):
def _onFinished(self, job):
if self._stream:
# Explicitly closing the stream flushes the write-buffer
- self._stream.close()
- self._stream = None
+ try:
+ self._stream.close()
+ self._stream = None
+ except:
+ Logger.logException("w", "An execption occured while trying to write to removable drive.")
+ message = Message(catalog.i18nc("@info:status", "Could not save to removable drive {0}: {1}").format(self.getName(),
+ str(
+ job.getError())))
+ message.show()
+ self.writeError.emit(self)
+ return
self._writing = False
self.writeFinished.emit(self)