Tezos: meta-package and pervasive type definitions for Tezos
Library tezos-base



include Tezos_error_monad.Sig.CORE
type error = ..
val error_encoding : error Data_encoding.t
val pp : Format.formatter -> error -> unit
val register_error_kind : Tezos_error_monad.Sig.error_category -> id:string -> title:string -> description:string -> ?pp:( Format.formatter -> 'err -> unit ) -> 'err Data_encoding.t -> ( error -> 'err option ) -> ( 'err -> error ) -> unit

The error data type is extensible. Each module can register specialized error serializers id unique name of this error. Ex.: overflow_time_counter title more readable name. Ex.: Overflow of time counter description human readable description. Ex.: The time counter overflowed while computing delta increase pp formatter used to pretty print additional arguments. Ex.: The time counter overflowed while computing delta increase. Previous value %d. Delta: %d encoder decoder data encoding for this error. If the error has no value, specify Data_encoding.empty

Classify an error using the registered kinds

include Tezos_error_monad.Sig.EXT with type error := error
type error +=
| Unclassified of string(*

Catch all error when 'deserializing' an error.


Catch all error when 'serializing' an error.

type error +=
| Unregistred_error of Data_encoding.json
val json_of_error : error -> Data_encoding.json

An error serializer

val error_of_json : Data_encoding.json -> error

Error documentation

type error_info = {
category : Tezos_error_monad.Sig.error_category;
id : string;
title : string;
description : string;
schema : Data_encoding.json_schema;

Error information

val pp_info : Format.formatter -> error_info -> unit
val get_registered_errors : unit -> error_info list

Retrieves information of registered errors

include Tezos_error_monad.Sig.WITH_WRAPPED with type error := error
module type Wrapped_error_monad = sig ... end
val register_wrapped_error_kind : (module Wrapped_error_monad) -> id:string -> title:string -> description:string -> unit