We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents adfb912 + b1550a0 commit fded046Copy full SHA for fded046
idl/xenvm_client.ml
@@ -41,8 +41,11 @@ module Rpc = struct
41
return (`Error e))
42
>>= function
43
| `Ok (resp, body) ->
44
- Cohttp_lwt_body.to_string body >>= fun body ->
45
- return (Jsonrpc.response_of_string body)
+ if Cohttp.(Code.is_success (Code.code_of_status resp.Response.status)) then
+ Cohttp_lwt_body.to_string body >>= fun body ->
46
+ return (Jsonrpc.response_of_string body)
47
+ else
48
+ fail (Failure "Error talking to xenvmd")
49
| `Retry e ->
50
let attempts_remaining = max 0 (attempts_remaining - 1) in
51
(if attempts_remaining > 0 then Lwt_unix.sleep 1. else return ())
0 commit comments