Module Proto.Rerror

An Rerror signifies a non-fatal error encountered while the server was handling a client's request, such as a missing file or insufficient permissions.

If 9P2000.u protocol extensions have been negotiated, the server may include a numeric error code which maps to common POSIX error codes.

type t
val size : t -> int

The size of this message in bytes. It is identical to the length of the underlying I/O vector but is also encoded in the first 4 bytes of the message.

val code : int

The op code for this message.

val tag : t -> Tag.t

An identifier for this transaction. All in-flight requests on a given connection must have unique tags.

val of_iovec : Iovec.t -> t

of_iovec verifies a message from an I/O vector. No copying is done, and of_iovec only performs bounds checks. Modifying the underlying I/O vector will change the results when accessing message fields.

val ename : t -> string

The error message, encoded in utf-8.

val errno : t -> int

An error number, or -1 if unset.

val alloc : Iovec.ring -> t
val commit : t -> tag:Tag.t -> ename:string -> int
val commit_ext : t -> tag:Tag.t -> ename:string -> errno:int -> int

commit_ext constructs a 9P2000.u Rerror message with the errno extension. It should only be used on connections using the 9P2000.u protocol version.