Source

ocaml-bitbucket / xcurl.ml

Diff from to
   h#perform;
   h#cleanup; (* Need to flush out cookies *)
   close_out oc;
-  (* CR jfuruse: what to do files when code <> 200? *)
-  ok200 (h#get_httpcode, Unix.rename tmp dst)
+  match h#get_httpcode with
+  | 200 -> Unix.rename tmp dst; `Ok dst
+  | e -> `Error (`Http (e, tmp))