1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-01-18 20:01:48 +01:00

Log error if dns system config could not be loaded

This commit is contained in:
Nikolay Kim 2019-04-04 15:41:05 -07:00
parent 810fa869ae
commit b9ea445e70
2 changed files with 11 additions and 5 deletions

View File

@ -1,6 +1,10 @@
# Changes
## [0.1.2] - 2019-04-xx
## [0.1.2] - 2019-04-04
### Added
* Log error if dns system config could not be loaded.
### Changed

View File

@ -47,10 +47,12 @@ pub fn start_resolver(cfg: ResolverConfig, opts: ResolverOpts) -> AsyncResolver
}
pub fn start_default_resolver() -> AsyncResolver {
let (cfg, opts) = if let Ok((cfg, opts)) = read_system_conf() {
(cfg, opts)
} else {
(ResolverConfig::default(), ResolverOpts::default())
let (cfg, opts) = match read_system_conf() {
Ok((cfg, opts)) => (cfg, opts),
Err(e) => {
log::error!("TRust-DNS can not load system config: {}", e);
(ResolverConfig::default(), ResolverOpts::default())
}
};
let (resolver, bg) = AsyncResolver::new(cfg, opts);