package octez-proto-libs

  1. Overview
  2. Docs
type error_category = [
  1. | `Branch
  2. | `Temporary
  3. | `Permanent
]

CORE : errors

type error = ..
val error_encoding : error Data_encoding.t
val pp : Format.formatter -> error -> unit

EXT : error registration/query

val register_error_kind : error_category -> id:string -> title:string -> description:string -> ?pp:(Format.formatter -> 'err -> unit) -> 'err Data_encoding.t -> (error -> 'err option) -> ('err -> error) -> unit
val classify_error : error -> error_category
val json_of_error : error -> Data_encoding.json
val error_of_json : Data_encoding.json -> error
type error_info = {
  1. category : error_category;
  2. id : string;
  3. title : string;
  4. description : string;
  5. schema : Data_encoding.json_schema;
}
val pp_info : Format.formatter -> error_info -> unit
val get_registered_errors : unit -> error_info list

Retrieves information of registered errors

MONAD : trace, monad, etc.

type 'err trace = 'err list
type 'a tzresult = ('a, error trace) Pervasives.result
val trace_encoding : error trace Data_encoding.t
val result_encoding : 'a Data_encoding.t -> 'a tzresult Data_encoding.t
val ok : 'a -> ('a, 'trace) Pervasives.result
val ok_unit : (unit, 'trace) Pervasives.result
val ok_none : ('a option, 'trace) Pervasives.result
val ok_some : 'a -> ('a option, 'trace) Pervasives.result
val ok_nil : ('a list, 'trace) Pervasives.result
val ok_true : (bool, 'trace) Pervasives.result
val ok_false : (bool, 'trace) Pervasives.result
val return : 'a -> ('a, 'trace) Pervasives.result Lwt.t
val return_unit : (unit, 'trace) Pervasives.result Lwt.t
val return_none : ('a option, 'trace) Pervasives.result Lwt.t
val return_some : 'a -> ('a option, 'trace) Pervasives.result Lwt.t
val return_nil : ('a list, 'trace) Pervasives.result Lwt.t
val return_true : (bool, 'trace) Pervasives.result Lwt.t
val return_false : (bool, 'trace) Pervasives.result Lwt.t
val error : 'err -> ('a, 'err trace) Pervasives.result
val fail : 'err -> ('a, 'err trace) Pervasives.result Lwt.t
val (>>=) : 'a Lwt.t -> ('a -> 'b Lwt.t) -> 'b Lwt.t
val (>|=) : 'a Lwt.t -> ('a -> 'b) -> 'b Lwt.t
val (>>?) : ('a, 'trace) Pervasives.result -> ('a -> ('b, 'trace) Pervasives.result) -> ('b, 'trace) Pervasives.result
val (>|?) : ('a, 'trace) Pervasives.result -> ('a -> 'b) -> ('b, 'trace) Pervasives.result
val (>>=?) : ('a, 'trace) Pervasives.result Lwt.t -> ('a -> ('b, 'trace) Pervasives.result Lwt.t) -> ('b, 'trace) Pervasives.result Lwt.t
val (>|=?) : ('a, 'trace) Pervasives.result Lwt.t -> ('a -> 'b) -> ('b, 'trace) Pervasives.result Lwt.t
val (>>?=) : ('a, 'trace) Pervasives.result -> ('a -> ('b, 'trace) Pervasives.result Lwt.t) -> ('b, 'trace) Pervasives.result Lwt.t
val (>|?=) : ('a, 'trace) Pervasives.result -> ('a -> 'b Lwt.t) -> ('b, 'trace) Pervasives.result Lwt.t
val record_trace : 'err -> ('a, 'err trace) Pervasives.result -> ('a, 'err trace) Pervasives.result
val trace : 'err -> ('b, 'err trace) Pervasives.result Lwt.t -> ('b, 'err trace) Pervasives.result Lwt.t
val record_trace_eval : (unit -> ('err, 'err trace) Pervasives.result) -> ('a, 'err trace) Pervasives.result -> ('a, 'err trace) Pervasives.result
val trace_eval : (unit -> ('err, 'err trace) Pervasives.result Lwt.t) -> ('b, 'err trace) Pervasives.result Lwt.t -> ('b, 'err trace) Pervasives.result Lwt.t
val error_unless : bool -> 'err -> (unit, 'err trace) Pervasives.result
val error_when : bool -> 'err -> (unit, 'err trace) Pervasives.result
val fail_unless : bool -> 'err -> (unit, 'err trace) Pervasives.result Lwt.t
val fail_when : bool -> 'err -> (unit, 'err trace) Pervasives.result Lwt.t
val unless : bool -> (unit -> (unit, 'trace) Pervasives.result Lwt.t) -> (unit, 'trace) Pervasives.result Lwt.t
val when_ : bool -> (unit -> (unit, 'trace) Pervasives.result Lwt.t) -> (unit, 'trace) Pervasives.result Lwt.t
val dont_wait : (exn -> unit) -> ('trace -> unit) -> (unit -> (unit, 'trace) Pervasives.result Lwt.t) -> unit
val iter : ('a -> (unit, 'trace) Pervasives.result) -> 'a list -> (unit, 'trace) Pervasives.result
val iter_s : ('a -> (unit, 'trace) Pervasives.result Lwt.t) -> 'a list -> (unit, 'trace) Pervasives.result Lwt.t
val map : ('a -> ('b, 'trace) Pervasives.result) -> 'a list -> ('b list, 'trace) Pervasives.result
val mapi : (int -> 'a -> ('b, 'trace) Pervasives.result) -> 'a list -> ('b list, 'trace) Pervasives.result
val map_s : ('a -> ('b, 'trace) Pervasives.result Lwt.t) -> 'a list -> ('b list, 'trace) Pervasives.result Lwt.t
val rev_map_s : ('a -> ('b, 'trace) Pervasives.result Lwt.t) -> 'a list -> ('b list, 'trace) Pervasives.result Lwt.t
val mapi_s : (int -> 'a -> ('b, 'trace) Pervasives.result Lwt.t) -> 'a list -> ('b list, 'trace) Pervasives.result Lwt.t
val map2 : ('a -> 'b -> ('c, 'trace) Pervasives.result) -> 'a list -> 'b list -> ('c list, 'trace) Pervasives.result
val mapi2 : (int -> 'a -> 'b -> ('c, 'trace) Pervasives.result) -> 'a list -> 'b list -> ('c list, 'trace) Pervasives.result
val map2_s : ('a -> 'b -> ('c, 'trace) Pervasives.result Lwt.t) -> 'a list -> 'b list -> ('c list, 'trace) Pervasives.result Lwt.t
val mapi2_s : (int -> 'a -> 'b -> ('c, 'trace) Pervasives.result Lwt.t) -> 'a list -> 'b list -> ('c list, 'trace) Pervasives.result Lwt.t
val filter_map_s : ('a -> ('b option, 'trace) Pervasives.result Lwt.t) -> 'a list -> ('b list, 'trace) Pervasives.result Lwt.t
val filter : ('a -> (bool, 'trace) Pervasives.result) -> 'a list -> ('a list, 'trace) Pervasives.result
val filter_s : ('a -> (bool, 'trace) Pervasives.result Lwt.t) -> 'a list -> ('a list, 'trace) Pervasives.result Lwt.t
val fold_left_s : ('a -> 'b -> ('a, 'trace) Pervasives.result Lwt.t) -> 'a -> 'b list -> ('a, 'trace) Pervasives.result Lwt.t
val fold_right_s : ('a -> 'b -> ('b, 'trace) Pervasives.result Lwt.t) -> 'a list -> 'b -> ('b, 'trace) Pervasives.result Lwt.t
val join_e : (unit, 'err trace) Pervasives.result list -> (unit, 'err trace) Pervasives.result
val all_e : ('a, 'err trace) Pervasives.result list -> ('a list, 'err trace) Pervasives.result
val both_e : ('a, 'err trace) Pervasives.result -> ('b, 'err trace) Pervasives.result -> ('a * 'b, 'err trace) Pervasives.result
OCaml

Innovation. Community. Security.