Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Error_event.t
is a generic event to emit values of type Error_monad.errorlist
.
type t = {
message : string option;
severity : [ `Fatal | `Recoverable ];
trace : Tezos_error_monad.Error_monad.error list;
}
val make :
?message:string ->
?severity:[ `Fatal | `Recoverable ] ->
Tezos_error_monad.Error_monad.error list ->
unit ->
t
include EVENT with type t := t
include EVENT_DEFINITION with type t := t
Defines the identifier for the event. Names should be unique and are restricted to alphanumeric characters or ".@-_+=,~"
.
val pp : short:bool -> Stdlib.Format.formatter -> t -> unit
val encoding : t Data_encoding.t
val emit :
?section:Section.t ->
(unit -> t) ->
unit Tezos_error_monad.Error_monad.tzresult Lwt.t
Output an event of type t
, if no sinks are listening the function won't be applied.
val log_error_and_recover :
?section:Section.t ->
?message:string ->
?severity:[ `Fatal | `Recoverable ] ->
(unit ->
(unit, Tezos_error_monad.Error_monad.error list) Stdlib.result Lwt.t) ->
unit Lwt.t
log_error_and_recover f
calls f ()
and emits an Error_event.t
event if it results in an error. It then continues in the _ Lwt.t
monad (e.g. there is no call to Lwt.fail
).