From 1db430c61a32a81bd93d08f55b7b29d13111cd68 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 3 Dec 2015 14:09:22 +0100 Subject: [PATCH] Log errors in case the file writing fails An error message is written to the log including the file that was not written to and the stringified exception. --- .../RemovableDriveOutputDevice/RemovableDriveOutputDevice.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py b/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py index 4ce9b6fd94..9fe5ab33be 100644 --- a/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py +++ b/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py @@ -63,8 +63,10 @@ class RemovableDriveOutputDevice(OutputDevice): self._writing = True job.start() except PermissionError as e: + Logger.log("e", "Permission denied when trying to write to %s: %s", file_name, str(e)) raise OutputDeviceError.PermissionDeniedError() from e except OSError as e: + Logger.log("e", "Operating system would not let us write to %s: %s", file_name, str(e)) raise OutputDeviceError.WriteRequestFailedError() from e def _onProgress(self, job, progress):