Skip to content

Commit

Permalink
Specific log for DNS resolution errors
Browse files Browse the repository at this point in the history
  • Loading branch information
r-n-o committed Jun 27, 2024
1 parent 9908906 commit 109044b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/qos_net/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ impl From<AddrParseError> for QosNetError {
impl From<ResolveError> for QosNetError {
fn from(err: ResolveError) -> Self {
let msg = format!("{err:?}");
Self::ParseError(msg)
Self::DNSResolutionError(msg)
}
}
5 changes: 4 additions & 1 deletion src/qos_net/src/proxy_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ fn resolve_hostname(
);
let resolver = Resolver::new(resolver_config, ResolverOpts::default())?;
println!("resolver ready");
let response = resolver.lookup_ip(hostname.clone())?;
let response = resolver.lookup_ip(hostname.clone()).map_err(|e| {
println!("error invoking resolver: {:?}", e);
QosNetError::from(e)
})?;
println!("resolver successfully invoked");
response.iter().next().ok_or_else(|| {
QosNetError::DNSResolutionError(format!(
Expand Down

0 comments on commit 109044b

Please sign in to comment.