Skip to content

Commit

Permalink
Merge pull request #15 from mozilla-services/feat/fix-resolver
Browse files Browse the repository at this point in the history
fix: detailed resolver errors
  • Loading branch information
bbangert committed Jun 22, 2018
2 parents 23b8b4e + 6bb2854 commit 2b59951
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ fn get_resolved_hostname() -> String {
let hostname = get_hostname().expect("Can't get hostname");
hostname
.to_socket_addrs()
.expect("Failed to resolve hostnames")
.expect(
&format!("Failed to resolve hostname: {}", hostname)
)
.last()
.expect("No hostnames found")
.expect("No IP's found for get_resolved_hostname")
.to_string()
}

Expand Down Expand Up @@ -114,9 +116,11 @@ impl Settings {
if self.resolve_hostname {
return hostname
.to_socket_addrs()
.expect("Failed to resolve hostnames")
.expect(
&format!("Failed to resolve provided hostname: {}", hostname)
)
.last()
.expect("No hostnames found")
.expect("No IP's found for provided hostname")
.to_string();
} else {
return hostname.clone();
Expand Down

0 comments on commit 2b59951

Please sign in to comment.