From 792c8c437f45d9fd2529f1ccab27faf79d98ba91 Mon Sep 17 00:00:00 2001 From: Adelyn Breelove Date: Mon, 17 Dec 2018 16:09:35 -0700 Subject: Some refactoring of http code --- lib/sharder.ml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/sharder.ml') diff --git a/lib/sharder.ml b/lib/sharder.ml index 98df132..5af3bbc 100644 --- a/lib/sharder.ml +++ b/lib/sharder.ml @@ -288,6 +288,10 @@ module Make(H : S.Http)(D : S.Dispatch) : S.Sharder = struct let start ?count () = let module J = Yojson.Safe.Util in H.get_gateway_bot () >>= fun data -> + let data = match data with + | Ok d -> Yojson.Safe.from_string d + | Error e -> Error.raise e + in let url = J.(member "url" data |> to_string) in let count = match count with | Some c -> c -- cgit v1.2.3