aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorache <ache@ache.one>2026-08-04 10:03:51 +0200
committerache <ache@ache.one>2026-08-04 10:03:51 +0200
commit3beb37c0b5e8ecb38e6b773e12ee8416972a44e1 (patch)
treef710ee6f3afd4a2be1ecea08264f281a836c4f07 /src
parentInit commit (diff)
Quit on error (Network for example)
Diffstat (limited to 'src')
-rw-r--r--src/main.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs
index cf24d9b..db0edf7 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -73,11 +73,10 @@ async fn main() {
states[id as usize] = State::Received { rtt: rrt, ttl };
}
}
- PingResult::NoPingErr { id, error } => {
- // NOTE: Maybe we should quit, I don't know.
- if (id as usize) < states.len() {
- states[id as usize] = State::SendError;
- }
+ PingResult::NoPingErr { id: _, ref error } => {
+ // FEAT: It should fail if states is empty and print a informative characters on the line otherwise
+ eprintln!("Error: {}", error);
+ std::process::exit(2);
}
}
}