Hcs.Grpc.Status

hcs · API reference

A gRPC call result. The code is one of the 17 canonical codes; the optional message is human-readable detail. The status travels in the response trailers as grpc-status (the integer code) and grpc-message (percent-encoded).

type code = 
  | OK
  | Cancelled
  | Unknown
  | Invalid_argument
  | Deadline_exceeded
  | Not_found
  | Already_exists
  | Permission_denied
  | Resource_exhausted
  | Failed_precondition
  | Aborted
  | Out_of_range
  | Unimplemented
  | Internal
  | Unavailable
  | Data_loss
  | Unauthenticated (* The canonical gRPC status codes (0..16). *)
type t = {
  code : code;
  message : string option;
}
val v : ?message:string -> code -> t

v ?message code builds a status.

val ok : t

OK with no message.

val is_ok : t -> bool

is_ok t is t.code = OK.

val code_to_int : code -> int
val code_of_int : int -> code option
val to_int : t -> int
val code_to_string : code -> string

The canonical screaming-snake-case name, e.g. NOT_FOUND.