From 0f20af88f12d093a761f4ebc634c63cbb3254fbd Mon Sep 17 00:00:00 2001 From: Goffi Date: Thu, 6 Oct 2022 16:02:05 +0200 Subject: [PATCH] tools (stream): log error when a SatFile is closed: error where only sent on `ProgressError`, but it is necessary to log the error as it may happen before any progression is started. --- sat/tools/stream.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sat/tools/stream.py b/sat/tools/stream.py index 0cf206b4..903507b8 100644 --- a/sat/tools/stream.py +++ b/sat/tools/stream.py @@ -63,7 +63,7 @@ class SatFile: if False, you'll have to call self.progressFinished and self.progressError yourself. progressStarted signal is always sent automatically - @param check_size_with_read(bool): if True, size well be checked using number of + @param check_size_with_read(bool): if True, size will be checked using number of bytes read or written. This is useful when data_cb modifiy len of file. """ self.host = host @@ -139,6 +139,8 @@ class SatFile: self.progressError(error) self.host.removeProgressCb(self.uid, self.profile) + if error is not None: + log.error(f"file {self._file} closed with an error: {error}") @property def closed(self):