diff options
| author | David Lönnhager <david.l@mullvad.net> | 2024-03-08 12:05:23 +0100 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2024-03-08 15:37:22 +0100 |
| commit | f282bbdf49448c7b5345c4e36a7ec55ee89f68a3 (patch) | |
| tree | 12e066792a427eab7c5749a126eb3342e1ec876e /talpid-routing/src | |
| parent | 565fc33a07df20c71d7e6d699dc3ad18ef262387 (diff) | |
| download | mullvadvpn-f282bbdf49448c7b5345c4e36a7ec55ee89f68a3.tar.xz mullvadvpn-f282bbdf49448c7b5345c4e36a7ec55ee89f68a3.zip | |
Print all source errors for macOS routing errors
Diffstat (limited to 'talpid-routing/src')
| -rw-r--r-- | talpid-routing/src/unix/macos/mod.rs | 7 | ||||
| -rw-r--r-- | talpid-routing/src/unix/macos/routing_socket.rs | 6 | ||||
| -rw-r--r-- | talpid-routing/src/unix/macos/watch.rs | 6 |
3 files changed, 12 insertions, 7 deletions
diff --git a/talpid-routing/src/unix/macos/mod.rs b/talpid-routing/src/unix/macos/mod.rs index 35220b45f8..3b3a0968f0 100644 --- a/talpid-routing/src/unix/macos/mod.rs +++ b/talpid-routing/src/unix/macos/mod.rs @@ -363,7 +363,12 @@ impl RouteManagerImpl { // ignore all other message types Ok(_) => {} Err(err) => { - log::error!("Failed to receive a message from the routing table: {err}"); + log::error!( + "{}", + err.display_chain_with_msg( + "Failed to receive a message from the routing table" + ) + ); } } } diff --git a/talpid-routing/src/unix/macos/routing_socket.rs b/talpid-routing/src/unix/macos/routing_socket.rs index 14e8ee088d..835e7d6edc 100644 --- a/talpid-routing/src/unix/macos/routing_socket.rs +++ b/talpid-routing/src/unix/macos/routing_socket.rs @@ -23,11 +23,11 @@ use tokio::io::{unix::AsyncFd, AsyncWrite, AsyncWriteExt}; #[derive(thiserror::Error, Debug)] pub enum Error { #[error("Failed to open routing socket")] - OpenSocket(io::Error), + OpenSocket(#[source] io::Error), #[error("Failed to write to routing socket")] - Write(io::Error), + Write(#[source] io::Error), #[error("Failed to read from routing socket")] - Read(io::Error), + Read(#[source] io::Error), #[error("Received a message that's too small")] MessageTooSmall(usize), #[error("Failed to receive response to route message")] diff --git a/talpid-routing/src/unix/macos/watch.rs b/talpid-routing/src/unix/macos/watch.rs index 20dc988086..1cef2e4205 100644 --- a/talpid-routing/src/unix/macos/watch.rs +++ b/talpid-routing/src/unix/macos/watch.rs @@ -10,14 +10,14 @@ type Result<T> = std::result::Result<T, Error>; #[derive(Debug, thiserror::Error)] pub enum Error { /// Generic routing socket error - #[error("Routing socket error: {0}")] - RoutingSocket(routing_socket::Error), + #[error("Routing socket error")] + RoutingSocket(#[source] routing_socket::Error), /// Failed to parse route message #[error("Invalid message")] InvalidMessage(data::Error), /// Failed to send route message #[error("Failed to send routing message")] - Send(routing_socket::Error), + Send(#[source] routing_socket::Error), /// Received unexpected response to route message #[error("Unexpected message type")] UnexpectedMessageType(RouteSocketMessage, MessageType), |
