From 6553c0e49c69d0496db72fdc1a7f664fd1b60c33 Mon Sep 17 00:00:00 2001 From: "Justin R. Porter" Date: Fri, 5 Jun 2026 08:38:22 -0400 Subject: [PATCH] Annotate Task.load() errors with task name and hash When a result file is corrupt (e.g. zlib decompression failure), the error now includes the task name and a truncated hash so the failing task can be identified. --- jug/task.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/jug/task.py b/jug/task.py index 693b861..a9dd5a6 100644 --- a/jug/task.py +++ b/jug/task.py @@ -172,7 +172,14 @@ def load(self): Nothing ''' assert self.can_load() - self._result = self.store.load(self.hash()) + try: + self._result = self.store.load(self.hash()) + except Exception as e: + h = self.hash().decode() + raise RuntimeError( + "Failed to load result for task '{}' (hash: {}, at '{}/{}'): {}".format( + self.name, h, h[:2], h[2:], e) + ) from e def invalidate(self): '''