package octez-proto-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=c6df840ebbf115e454db949028c595bec558a59a66cade73b52a6d099d6fa4d4
sha512=d8aee903b9fe130d73176bc8ec38b78c9ff65317da3cb4f3415f09af0c625b4384e7498201fdb61aa39086a7d5d409d0ab3423f9bc3ab989a680cf444a79bc13
doc/octez-proto-libs.protocol-environment/Tezos_protocol_environment/V0/Make/Error_monad/index.html
Module Make.Error_monad
Source
Tezos Protocol Implementation - Error Monad
Error classification
type error_category = [
| `Branch
(*Errors that may not happen in another context
*)| `Temporary
(*Errors that may not happen in a later context
*)| `Permanent
(*Errors that will happen no matter the context
*)
]
Categories of error
Custom error handling for economic protocols.
val pp : Format.formatter -> error -> unit
A JSON error serializer
val json_of_error : error -> Data_encoding.json
val error_of_json : Data_encoding.json -> error
type error_info = {
category : 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
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
For other modules to register specialized error serializers
Classify an error using the registered kinds
Monad definition
type 'a tzresult = ('a, error list) Pervasives.result
val result_encoding : 'a Data_encoding.t -> 'a tzresult Data_encoding.encoding
A JSON serializer for result of a given type
val ok : 'a -> 'a tzresult
Successful result
Enrich an error report (or do nothing on a successful result) manually
Automatically enrich error reporting on stack rewind
Same as record_trace, for unevaluated error
Same as trace, for unevaluated Lwt error
In-monad list iterators
A List.map2
in the monad
A List.map2
in the monad
A List.filter_map
in the monad
A List.fold_left
in the monad
A List.fold_right
in the monad