Module Eio_fs_chaos.FaultSource

The faults a wrapper injects.

type code = [
  1. | `Enoent
  2. | `Eacces
  3. | `Eperm
  4. | `Erofs
  5. | `Enospc
  6. | `Eio
]

The type for error codes. `Enoent raises Eio.Fs.error.Not_found on an open, a stat or a change, `Eacces and `Eperm raise Eio.Fs.error.Permission_denied there, and the others an Eio.Io error that names them.

type t =
  1. | Fail of code
    (*

    The operation fails with that error. ENOSPC applies to a write, and to an open or a change that makes a file or an entry only.

    *)
  2. | Evict of code
    (*

    A sync fails with that error, and the page cache drops the pages it could not write: under Power.wrap, a later read of them sees the bytes the disk holds. Elsewhere it is Fail.

    *)
  3. | Short of int
    (*

    A read or a write moves at most max 1 n bytes.

    *)
  4. | Torn of int
    (*

    A write stores its first n bytes, then fails with ENOSPC.

    *)

The type for faults. One that does not apply to an operation does nothing.

val pp : t Fmt.t

pp formats a fault for logs and reports.