输出增加颜色
This commit is contained in:
@@ -165,6 +165,7 @@ pub enum ErrorType {
|
||||
AddressExhausted,
|
||||
IpAlreadyExists,
|
||||
InvalidIp,
|
||||
LocalIpExists,
|
||||
Unknown,
|
||||
}
|
||||
|
||||
@@ -176,7 +177,8 @@ impl Into<u8> for ErrorType {
|
||||
ErrorType::AddressExhausted => 3,
|
||||
ErrorType::IpAlreadyExists => 4,
|
||||
ErrorType::InvalidIp => 5,
|
||||
ErrorType::Unknown => 6,
|
||||
ErrorType::LocalIpExists => 6,
|
||||
ErrorType::Unknown => 255,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ impl<Call: VntCallback> ServerPacketHandler<Call> {
|
||||
}
|
||||
if let Err(e) = self.device.set_ip(virtual_ip, virtual_netmask) {
|
||||
self.callback.error(ErrorInfo::new_msg(
|
||||
ErrorType::Unknown,
|
||||
ErrorType::LocalIpExists,
|
||||
format!("set_ip {:?}", e),
|
||||
));
|
||||
return Ok(());
|
||||
|
||||
Reference in New Issue
Block a user