Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emit higher-quality error message on node failure #584

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lenskit/lenskit/pipeline/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def run(self, node: Node[Any], *, required: bool = True) -> Any:
"""
Run the pipleline to obtain the results of a node.
"""
log = _log.bind(node=node.name)
status = self.status[node.name]
if status == "finished":
return self.state[node.name]
Expand All @@ -62,13 +63,13 @@ def run(self, node: Node[Any], *, required: bool = True) -> Any:
elif status == "failed": # pragma: nocover
raise RuntimeError(f"{node} previously failed")

trace(self.log, "processing node", node=node.name)
trace(log, "processing node")
self.status[node.name] = "in-progress"
try:
self._run_node(node, required)
self.status[node.name] = "finished"
except Exception as e:
_log.error("node %s failed with error %s", node, e)
log.error("failed to run node", exc_info=e)
self.status[node.name] = "failed"
raise e

Expand Down
Loading