From 9b0c6cb3253798d3eb6aa12ffddb66eda0bcb847 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 21 Jul 2021 12:21:36 +0200 Subject: Clearify progress-bar error message If there are no "other tasks", an error couldn't have happened on another task. Thus, adapt the error message properly. Signed-off-by: Matthias Beyer --- src/orchestrator/orchestrator.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/orchestrator/orchestrator.rs') diff --git a/src/orchestrator/orchestrator.rs b/src/orchestrator/orchestrator.rs index 7a36f97..836b0f0 100644 --- a/src/orchestrator/orchestrator.rs +++ b/src/orchestrator/orchestrator.rs @@ -461,10 +461,19 @@ struct JobTask<'a> { impl<'a> Drop for JobTask<'a> { fn drop(&mut self) { if !self.bar.is_finished() { - self.bar.finish_with_message(format!("[{} {} {}] Stopped, error on other task", + // If there are dependencies, the error is probably from another task + // If there are no dependencies, the error was caused by something else + let errmsg = if self.jobdef.dependencies.is_empty() { + "error occured" + } else { + "error on other task" + }; + + self.bar.finish_with_message(format!("[{} {} {}] Stopped, {msg}", self.jobdef.job.uuid(), self.jobdef.job.package().name(), - self.jobdef.job.package().version())); + self.jobdef.job.package().version(), + msg = errmsg)); } } } -- cgit v1.2.3