From fd2c043a5da73fc1222779f28d1fdfc3763683eb Mon Sep 17 00:00:00 2001 From: Sebastien Mondet Date: Thu, 14 Feb 2019 11:22:52 -0500 Subject: [PATCH] Return proper error message in ocp-resto/client --- vendors/ocplib-resto/lib_resto-cohttp/client.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendors/ocplib-resto/lib_resto-cohttp/client.ml b/vendors/ocplib-resto/lib_resto-cohttp/client.ml index 78d2e59d8..11649eea5 100644 --- a/vendors/ocplib-resto/lib_resto-cohttp/client.ml +++ b/vendors/ocplib-resto/lib_resto-cohttp/client.ml @@ -219,7 +219,7 @@ module Make (Encoding : Resto.ENCODING) = struct else Lwt.return (`Error (ansbody, media_name, media)) | `Bad_request -> - Cohttp_lwt.Body.to_string body >>= fun body -> + Cohttp_lwt.Body.to_string ansbody >>= fun body -> Lwt.return (`Bad_request body) | `Method_not_allowed -> let allowed = Cohttp.Header.get_multi headers "accept" in @@ -227,7 +227,7 @@ module Make (Encoding : Resto.ENCODING) = struct | `Unsupported_media_type -> Lwt.return `Unsupported_media_type | `Not_acceptable -> - Cohttp_lwt.Body.to_string body >>= fun body -> + Cohttp_lwt.Body.to_string ansbody >>= fun body -> Lwt.return (`Not_acceptable body) | code -> Lwt.return