*: Improve MonitoredTasks' error capture

This commit is contained in:
Jens Langhammer
2020-10-16 16:00:24 +02:00
parent bdc019c7cf
commit 2339e855bb
5 changed files with 11 additions and 6 deletions

View File

@ -27,4 +27,4 @@ def update_latest_version(self: MonitoredTask):
)
except (RequestException, IndexError) as exc:
cache.set(VERSION_CACHE_KEY, "0.0.0", VERSION_CACHE_TIMEOUT)
self.set_status(TaskResult(TaskResultStatus.ERROR, [str(exc)]))
self.set_status(TaskResult(TaskResultStatus.ERROR).with_error(exc))