package otoggl

  1. Overview
  2. Docs
Bindings for Toggl API in OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

dev-0.3.2.tbz
sha256=22ee2dc184836891b833d6791bea35f583e24bb2ce87ae4f6e5dcbdb272dc4c9
sha512=89508c18662001029e6d3707dae82edd67a17a7fecc200d7c0da3c4ac8f45b6676e0dec69483234f2170b31451f36735903c89e85cb2a713fe8a4df327964f74

doc/src/otoggl.lib/util.ml.html

Source file util.ml

1
2
3
4
5
6
7
8
open Piaf

let status_200_or_error (response : Response.t) : (string, Error.t) Lwt_result.t
  =
  let open Lwt_result in
  if Status.is_successful @@ response.status
  then Body.to_string response.body
  else bind (Body.to_string response.body >|= fun s -> (`Msg s :> Error.t)) fail
OCaml

Innovation. Community. Security.