From b9ea445e709a718da933d5bd4ee7a153d66604aa Mon Sep 17 00:00:00 2001
From: Nikolay Kim <fafhrd91@gmail.com>
Date: Thu, 4 Apr 2019 15:41:05 -0700
Subject: [PATCH] Log error if dns system config could not be loaded

---
 actix-connect/CHANGES.md |  6 +++++-
 actix-connect/src/lib.rs | 10 ++++++----
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/actix-connect/CHANGES.md b/actix-connect/CHANGES.md
index 12fbeed5..4a3e86bc 100644
--- a/actix-connect/CHANGES.md
+++ b/actix-connect/CHANGES.md
@@ -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
 
diff --git a/actix-connect/src/lib.rs b/actix-connect/src/lib.rs
index 6d7b0bc8..bc61f290 100644
--- a/actix-connect/src/lib.rs
+++ b/actix-connect/src/lib.rs
@@ -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);