Unhelpful error messages when deserializing configuration fails
When you try to start Arti with this configuration file:
[proxy]
socks_listen = "fred"
You get an not-so-helpful error message:
./target/quicktest/arti: error: read configuration: Config contents not as expected: Invalid listen specification: failed to parse string: invalid socket address syntax
Note that it doesn't mention proxy.socks_listen, or "fred"!
Under the hood, this is:
anyhow::Error {
context: "read configuration",
source: tor_config::ConfigResolveError::Deserialize(
config::ConfigError::Message(
"Invalid listen specification: failed to parse string: invalid socket address syntax",
),
),
}
The inner "invalid listen specification:…" string was apparently Displayed from a tor_config::misc::InvalidListen::InvalidString. That latter error was constructed when we tried to deserialize a tor_config::misc::Listen.
I hope that this doesn't require major serde shenanigans.