summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <matthias.beyer@atos.net>2021-07-21 12:21:36 +0200
committerMatthias Beyer <matthias.beyer@atos.net>2021-07-27 12:52:48 +0200
commit9b0c6cb3253798d3eb6aa12ffddb66eda0bcb847 (patch)
tree15d9d87f9ec99332788d6daea2e83bc347ef6629
parent544b4348c4073e63635e08a1758f947d0c8099f6 (diff)
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 <matthias.beyer@atos.net>
-rw-r--r--src/orchestrator/orchestrator.rs13
1 files changed, 11 insertions, 2 deletions
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));
}
}
}