aboutsummaryrefslogtreecommitdiff
path: root/lib/sharder.ml
diff options
context:
space:
mode:
authorAdelyn Breelove <[email protected]>2018-12-17 16:09:35 -0700
committerAdelyn Breelove <[email protected]>2018-12-17 16:09:35 -0700
commit792c8c437f45d9fd2529f1ccab27faf79d98ba91 (patch)
tree3c8f5e59d617219a3d442083c29d5cbdfa6ffdb5 /lib/sharder.ml
parentMore stuff (diff)
downloaddisml-792c8c437f45d9fd2529f1ccab27faf79d98ba91.tar.xz
disml-792c8c437f45d9fd2529f1ccab27faf79d98ba91.zip
Some refactoring of http code
Diffstat (limited to 'lib/sharder.ml')
-rw-r--r--lib/sharder.ml4
1 files changed, 4 insertions, 0 deletions
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