Skip to content

Commit c3879b3

Browse files
committed
Remove false error reporting for unused targets
Signed-off-by: Michael X. Grey <grey@openrobotics.org>
1 parent 23354cd commit c3879b3

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/operation.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -627,12 +627,16 @@ struct OperationReachabiilityStorage(
627627

628628
pub fn execute_operation(request: OperationRequest) {
629629
let Some(operator) = request.world.get::<OperationExecuteStorage>(request.source) else {
630-
request.world.get_resource_or_insert_with(|| UnhandledErrors::default())
631-
.broken
632-
.push(Broken {
633-
node: request.source,
634-
backtrace: Some(Backtrace::new())
635-
});
630+
if request.world.get::<UnusedTarget>(request.source).is_none() {
631+
// The node does not have an operation and is not an unused target,
632+
// so this is broken somehow.
633+
request.world.get_resource_or_insert_with(|| UnhandledErrors::default())
634+
.broken
635+
.push(Broken {
636+
node: request.source,
637+
backtrace: Some(Backtrace::new())
638+
});
639+
}
636640
return;
637641
};
638642
let operator = operator.0;

src/workflow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ mod tests {
403403
});
404404

405405
context.run_with_conditions(&mut promise, Duration::from_secs(2));
406-
dbg!(promise.peek());
407406
assert!(promise.peek().is_cancelled());
407+
assert!(context.no_unhandled_errors());
408408
}
409409
}

0 commit comments

Comments
 (0)