- (** internal: parse a code argument from a function which have two optional
- arguments "code" and "status" *)
-let get_code_argument func_name =
- fun ~code ~status ->
- (match code, status with
- | Some c, None -> c
- | None, Some s -> code_of_status s
- | Some _, Some _ -> (* TODO use some static type checking *)
- failwith (func_name ^ " you must give 'code' or 'status', not both")
- | None, None -> (* TODO use some static type checking *)
- failwith (func_name ^ " you must give 'code' or 'status', not none"))
-