From a832c2069fd3a0bc6e07238fa75e76af4ee9e2f5 Mon Sep 17 00:00:00 2001 From: Vincent Bernardoff Date: Wed, 30 Nov 2016 15:04:06 +0100 Subject: [PATCH] P2P: Do not log ``ordinary'' errors --- src/node/net/p2p.ml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/node/net/p2p.ml b/src/node/net/p2p.ml index ed8cc3ab5..2165830f5 100644 --- a/src/node/net/p2p.ml +++ b/src/node/net/p2p.ml @@ -424,11 +424,13 @@ module Make (P: PARAMS) = struct port = config.incoming_port ; versions = P.supported_versions }) >>= fun _ -> Lwt.pick - [ ( LU.sleep limits.peer_answer_timeout >>= fun () -> - Error_monad.fail Timeout ) ; + [ ( LU.sleep limits.peer_answer_timeout >>= fun () -> Error_monad.fail Timeout ) ; recv buf ] >>= function + | Error [Timeout] | Error [Canceled] | Error [Exn End_of_file] -> + (* Expected errors. No logging. *) + cancel () | Error err -> - debug "(%a) error receiving from %a:%d: %a" + log_error "(%a) error receiving from %a:%d: %a" pp_gid my_gid Ipaddr.pp_hum addr port Error_monad.pp_print_error err ; cancel () | Ok (Connect { gid; port = listening_port; versions ;