From 527a2fb6217329c7d133e5733e65b45d76f0913a Mon Sep 17 00:00:00 2001 From: MBourgoin Date: Tue, 6 Nov 2018 13:12:11 +0100 Subject: [PATCH] Client/Context_unix: load_file print error --- src/lib_client_base_unix/client_context_unix.ml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lib_client_base_unix/client_context_unix.ml b/src/lib_client_base_unix/client_context_unix.ml index 67e0429bd..b92e81b2f 100644 --- a/src/lib_client_base_unix/client_context_unix.ml +++ b/src/lib_client_base_unix/client_context_unix.ml @@ -24,6 +24,9 @@ (*****************************************************************************) open Client_context +include Tezos_stdlib.Logging.Make_semantic(struct let name = "client.context.unix" end) + +let filename_tag = Tag.def ~doc:"Filename" "filename" Format.pp_print_string class unix_wallet ~base_dir : wallet = object (self) @@ -63,7 +66,13 @@ class unix_wallet ~base_dir : wallet = object (self) |> generic_trace "could not read the %s alias file" alias_name >>=? fun json -> match Data_encoding.Json.destruct encoding json with - | exception _ -> (* TODO print_error *) + | exception e -> + lwt_log_error Tag.DSL.(fun f -> + f "did not understand the %s alias file %s : %a" + -% t event "load error" + -% s filename_tag alias_name + -% s filename_tag filename + -% a exn e) >>= fun () -> failwith "did not understand the %s alias file %s" alias_name filename | data -> return data