[mio] 完善提示信息

This commit is contained in:
lubeilin
2024-03-13 21:17:01 +08:00
parent 066e655c30
commit d2c5aac178
4 changed files with 31 additions and 10 deletions
+11 -1
View File
@@ -2,7 +2,7 @@ use std::process;
use console::style;
use vnt::handle::callback::ConnectInfo;
use vnt::handle::callback::{ConnectInfo, ErrorType};
use vnt::{DeviceInfo, ErrorInfo, HandshakeInfo, RegisterInfo, VntCallback};
#[derive(Clone)]
@@ -32,6 +32,16 @@ impl VntCallback for VntHandler {
fn error(&self, info: ErrorInfo) {
println!("{}", style(format!("error {}", info)).red());
match info.code {
ErrorType::TokenError
| ErrorType::AddressExhausted
| ErrorType::IpAlreadyExists
| ErrorType::InvalidIp
| ErrorType::LocalIpExists => {
self.stop();
}
_ => {}
}
}
fn stop(&self) {