# HG changeset patch # User Goffi # Date 1665064925 -7200 # Node ID e4631d073c8bbac9e38dde040dc0d25f2a18ab29 # Parent 13a2403774d4c21de74ea606a1a50154ee6e6343 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. diff -r 13a2403774d4 -r e4631d073c8b sat/tools/stream.py --- a/sat/tools/stream.py Thu Oct 06 16:02:05 2022 +0200 +++ b/sat/tools/stream.py Thu Oct 06 16:02:05 2022 +0200 @@ -63,7 +63,7 @@ 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 @@ 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):