Improve pinger error handling

This commit is contained in:
Nils Andreas Svee committed 2022-10-13 17:16:01 +02:00
1 parent 290450ac1e
commit 9a1901b213
3 files changed
+29 -16

No files matched your search

+9 -6
View File
@@ -51,15 +51,18 @@ impl PingListener for PingerICMPEchoListener {
+ (time_now.tv_nsec() as f64 / 1e9),
});
}
_ => {
todo!()
type_ => {
return Err(PingError::InvalidType(format!("{:?}", type_)));
}
},
Some(Icmpv6(_)) => {
todo!()
Some(Icmpv6(slice)) => {
return Err(PingError::InvalidProtocol(format!("{:?}", slice)));
}
_ => {
unimplemented!()
Some(type_) => {
return Err(PingError::InvalidProtocol(format!("{:?}", type_)));
}
None => {
return Err(PingError::NoTransport);
}
},
}