From 7b3d94db8cdba7db0d8786cd53c44c4f9822e216 Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Sat, 3 Nov 2018 00:04:14 +0100 Subject: [PATCH] more debug output from vmmd_tls --- app/vmmd_tls.ml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/vmmd_tls.ml b/app/vmmd_tls.ml index d32cbd7..3509f9f 100644 --- a/app/vmmd_tls.ml +++ b/app/vmmd_tls.ml @@ -78,16 +78,18 @@ let handle ca (tls, addr) = | Error `Exception -> Lwt.return (Error (`Msg "failed to write policy")) | Ok () -> Vmm_lwt.read_wire fd >|= function - | Error _ -> Error (`Msg "read error") + | Error _ -> Error (`Msg "read error after writing policy") | Ok (_, `Success _) -> Ok () - | Ok _ -> + | Ok wire -> (* TODO check version *) - Error (`Msg ("expected success, received something else when adding policy"))) + Rresult.R.error_msgf + "expected success when adding policy, got: %a" + Vmm_commands.pp_wire wire) (Ok ()) policies | _ -> Lwt.return (Ok ())) >>= function | Error (`Msg msg) -> begin - Logs.debug (fun m -> m "error while applying policies %s" msg) ; + Logs.warn (fun m -> m "error while applying policies %s" msg) ; let wire = let header = Vmm_commands.{version = my_version ; sequence = 0L ; id = name } in header, `Failure msg