Mercurial > libervia-backend
changeset 3924:e4631d073c8b
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.
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 06 Oct 2022 16:02:05 +0200 |
parents | 13a2403774d4 |
children | 900bf04d87c8 |
files | sat/tools/stream.py |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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):