Skip to content

Commit

Permalink
server: detail error message (#12)
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaobo Liu <[email protected]>
  • Loading branch information
cppcoffee authored Jan 16, 2024
1 parent 983072c commit 261c83b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion server/src/conntrack/reclaim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl ConntrackReclaim {
info!("reclaim expired entries: {}, total: {}", prev - len, len);
}
Err(e) => {
error!("reclaim expired entries failed: {e}")
error!("reclaim expired entries failed: {:?}", e)
}
}
});
Expand Down
8 changes: 4 additions & 4 deletions server/src/reject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,15 @@ impl Sender {
icmp_packet,
} => {
if let Err(e) = self.icmp.send_to(icmp_packet, destination) {
error!("Failed to send ICMP packet: {}", e);
error!("Failed to send ICMP packet: {:?}", e);
}
}
Message::Icmpv6 {
destination,
icmp_packet,
} => {
if let Err(e) = self.icmpv6.send_to(icmp_packet, destination) {
error!("Failed to send ICMPv6 packet: {}", e);
error!("Failed to send ICMPv6 packet: {:?}", e);
}
}
Message::Tcp {
Expand All @@ -194,12 +194,12 @@ impl Sender {
} => match destination {
IpAddr::V4(_) => {
if let Err(e) = self.tcp.send_to(tcp_packet, destination) {
error!("Failed to send TCP packet: {}", e);
error!("Failed to send TCP packet: {:?}", e);
}
}
IpAddr::V6(_) => {
if let Err(e) = self.tcp6.send_to(tcp_packet, destination) {
error!("Failed to send TCP packet: {}", e);
error!("Failed to send TCP packet: {:?}", e);
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions server/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ impl Worker {
let this = self.clone();
thread::spawn(move || {
if let Err(e) = util::set_thread_priority() {
error!("nfq {queue_num} failed to set thread priority: {e}");
error!("nfq {} failed to set thread priority: {:?}", queue_num, e);
return;
}

info!("nfq {queue_num} worker started");

loop {
if let Err(e) = this.event_handler(&mut queue) {
error!("nfq {queue_num} failed handle event: {e}");
error!("nfq {} failed handle event: {}", queue_num, e);
continue;
}
}
Expand Down

0 comments on commit 261c83b

Please sign in to comment.