From 3776e6853d64766904218fec664a8431a4cb55e4 Mon Sep 17 00:00:00 2001 From: Pietro Abate Date: Mon, 29 Oct 2018 10:33:42 +0100 Subject: [PATCH] Error Monad: add docstring to register_error_kind --- src/lib_error_monad/error_monad_sig.ml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/lib_error_monad/error_monad_sig.ml b/src/lib_error_monad/error_monad_sig.ml index d4e2a562e..784988a43 100644 --- a/src/lib_error_monad/error_monad_sig.ml +++ b/src/lib_error_monad/error_monad_sig.ml @@ -64,13 +64,24 @@ module type S = sig (** {2 Error classification} ***********************************************) - (** For other modules to register specialized error serializers *) + (** The error data type is extensible. Each module can register specialized + error serializers + [id] unique name of this error. Ex.: overflow_time_counter + [title] human readable description. Ex.: The time counter overflown while computing delta increase + [description] formatter use to pretty print additional arguments. Ex.: The time counter overflown while computing delta increase. Previsous value %d. Delta: %d + [pp] data encoding for this error. If the error has no value, specify Data_encoding.empty + [encoder] + [decoder] + *) val register_error_kind : error_category -> - id:string -> title:string -> description:string -> + id:string -> + title:string -> + description:string -> ?pp:(Format.formatter -> 'err -> unit) -> 'err Data_encoding.t -> - (error -> 'err option) -> ('err -> error) -> + (error -> 'err option) -> + ('err -> error) -> unit (** Classify an error using the registered kinds *)