Return proper error message in ocp-resto/client
This commit is contained in:
parent
27c5bc86c0
commit
fd2c043a5d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user