package octez-proto-libs
- Overview
- No Docs
You can search for identifiers within the package.
in-package search v0.2.0
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=dbc3b675aee59c2c574e5d0a771193a2ecfca31e7a5bc5aed66598080596ce1c
sha512=b97ed762b9d24744305c358af0d20f394376b64bfdd758dd4a81775326caf445caa57c4f6445da3dd6468ff492de18e4c14af6f374dfcbb7e4d64b7b720e5e2a
doc/octez-proto-libs.protocol-environment/Tezos_protocol_environment/V0/Make/Error_monad/index.html
Module Make.Error_monadSource
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 -> unitA JSON error serializer
val json_of_error : error -> Data_encoding.jsonval error_of_json : Data_encoding.json -> errortype 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 -> unitval get_registered_errors : unit -> error_info listRetrieves 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) ->
unitFor other modules to register specialized error serializers
Classify an error using the registered kinds
Monad definition
type 'a tzresult = ('a, error list) Pervasives.resultval result_encoding : 'a Data_encoding.t -> 'a tzresult Data_encoding.encodingA JSON serializer for result of a given type
val ok : 'a -> 'a tzresultSuccessful 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