summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2015-10-01 22:32:12 +0600
committerDaniil Baturin <daniil@baturin.org>2015-10-01 22:32:12 +0600
commit274c49d89623b95f8b682b8dba5e9db9174ec808 (patch)
treec6580c7400fab1f0cab8c53621514aa8fcba3eb3 /src
parent7c7fdeb7e906d4f69b39cdf1635d706e04069e3f (diff)
downloadvyconf-274c49d89623b95f8b682b8dba5e9db9174ec808.tar.gz
vyconf-274c49d89623b95f8b682b8dba5e9db9174ec808.zip
Some error handling in config loading.
Diffstat (limited to 'src')
-rw-r--r--src/vyconfd.ml12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/vyconfd.ml b/src/vyconfd.ml
index 4a5cd5d..29345fb 100644
--- a/src/vyconfd.ml
+++ b/src/vyconfd.ml
@@ -1,5 +1,15 @@
+open Lwt
open Defaults
-let config = Vyconf_config.load defaults.config_file
+let () = Lwt_log.add_rule "*" Lwt_log.Info
+
+let config =
+ let result = Vyconf_config.load defaults.config_file in
+ match result with
+ | `Ok cfg -> cfg
+ | `Error err ->
+ Lwt_log.fatal (Printf.sprintf "Could not load the configuration file %s" err); exit 1
+
+
let () = print_endline "This is VyConf. Or, rather, will be."