Module Api_error.Code

type t =
  1. | Int of int
  2. | String of string

Error codes are usually integer HTTP status codes (400, 429, …) on the main endpoints, but mid-stream chunks and the Responses API surface string codes like "server_error" or "rate_limit_exceeded".

include Ppx_jsonaf_conv_lib.Jsonafable.S with type t := t
val t_of_jsonaf : Jsonaf_kernel__.Type.t -> t
val jsonaf_of_t : t -> Jsonaf_kernel__.Type.t
include Sexplib0.Sexpable.S with type t := t
val t_of_sexp : Sexplib0__.Sexp.t -> t
val sexp_of_t : t -> Sexplib0__.Sexp.t