Imandrakit_error.Error
Universal error type for Imandrakit.
Exposes the standard errors that Imandrakit can raise.
include module type of Error_core
A message.
An error message is emitted at a particular place in the code. An error can contain several error messages.
val message_to_twine : message Imandrakit_twine.Encode.encoder
val message_of_twine : message Imandrakit_twine.Decode.decoder
type stack = message list
val pp :
Ppx_deriving_runtime.Format.formatter ->
t ->
Ppx_deriving_runtime.unit
val show : t -> Ppx_deriving_runtime.string
val to_twine : t Imandrakit_twine.Encode.encoder
val of_twine : t Imandrakit_twine.Decode.decoder
exception E of t
Internal error
val pp_with : show_process:bool -> t Imandrakit_common.Fmt.printer
module Message : sig ... end
val raise_err : ?bt:Stdlib.Printexc.raw_backtrace -> t -> 'a
val guard : ?let_pass:(exn -> bool) -> (unit -> message) -> (unit -> 'a) -> 'a
guard g f
behaves like f()
, excepts that if f()
raises Error e
, guard g f
raises Error e'
where e'
wraps e
with context error g()
.
val pp_result :
(Ppx_deriving_runtime.Format.formatter -> 'a -> Ppx_deriving_runtime.unit) ->
Ppx_deriving_runtime.Format.formatter ->
'a result ->
Ppx_deriving_runtime.unit
val show_result :
(Ppx_deriving_runtime.Format.formatter -> 'a -> Ppx_deriving_runtime.unit) ->
'a result ->
Ppx_deriving_runtime.string
val iter_result :
('a -> Ppx_deriving_runtime.unit) ->
'a result ->
Ppx_deriving_runtime.unit
val result_to_twine :
'a Imandrakit_twine.Encode.encoder ->
'a result Imandrakit_twine.Encode.encoder
val result_of_twine :
'a Imandrakit_twine.Decode.decoder ->
'a result Imandrakit_twine.Decode.decoder
module Infix : sig ... end
module Kind = Kind
fail "some error message"
raises an error with the given message
val failf :
?stack:message list ->
?process:string ->
?bt:string ->
kind:Kind.t ->
('a, Stdlib.Format.formatter, unit, 'b) format4 ->
'a
errorf "some error message %s (number %d)" "with formatting" 42
raises an error with the given formatted message
val mk_errorf :
?stack:message list ->
?process:string ->
?bt:string ->
kind:Kind.t ->
('a, Stdlib.Format.formatter, unit, t) format4 ->
'a
val message : ?bt:string -> string -> message
val messagef :
?bt:string ->
('a, Stdlib.Format.formatter, unit, message) format4 ->
'a
val guardf :
?let_pass:(exn -> bool) ->
((('a, Stdlib.Format.formatter, unit, message) format4 -> 'a) -> message) ->
(unit -> 'b) ->
'b
guardf ~loc k f
behaves like f()
, but will call k
to produce a contextual message in case of error.
val of_exn : ?bt:Stdlib.Printexc.raw_backtrace -> kind:Kind.t -> exn -> t
Turn exception into an error.