Skip to content

Commit 3d31e46

Browse files
committed
faux-mgs: exit nonzero if we encountered any errors
1 parent 1709a92 commit 3d31e46

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

faux-mgs/src/main.rs

+6
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,7 @@ async fn main() -> Result<()> {
837837
.collect::<FuturesOrdered<_>>();
838838

839839
let mut by_interface = BTreeMap::new();
840+
let mut did_fail = false;
840841
while let Some((interface, result)) = all_results.next().await {
841842
let prefix = if args.json.is_none() && num_sps > 1 {
842843
format!("{interface:maxwidth$} ")
@@ -853,6 +854,7 @@ async fn main() -> Result<()> {
853854
}
854855
}
855856
Err(err) => {
857+
did_fail = true;
856858
if args.json.is_some() {
857859
by_interface.insert(interface, Err(format!("{err:#}")));
858860
} else {
@@ -876,6 +878,10 @@ async fn main() -> Result<()> {
876878
}
877879
}
878880

881+
if did_fail {
882+
std::process::exit(1);
883+
}
884+
879885
Ok(())
880886
}
881887

0 commit comments

Comments
 (0)