package eio

  1. Overview
  2. Docs

Extensible backend-specific exceptions.

type t = ..
val show : bool Stdlib.ref

Controls the behaviour of pp.

val register_pp : (Stdlib.Format.formatter -> t -> bool) -> unit

register_pp pp adds pp as a pretty-printer of backend errors.

pp f err should format err using f, if possible. It should return true on success, or false if it didn't recognise err.

val pp : t Fmt.t

pp behaves like pp except that if display of backend errors has been turned off (with show) then it just prints a place-holder.

This is useful for formatting the backend-specific part of exceptions, which should be hidden in expect-style testing that needs to work on multiple backends.

OCaml

Innovation. Community. Security.