classify_error : Bytes -> ErrorClass
Reply
:= []
Strict, reusable decoders for common Redis RESP2 reply shapes.
Nullable decoders accept the matching null kind and reject the other kind.
Redis error replies are separated from shape mismatches. Commands with
richer or version-dependent replies can continue to inspect Resp.Resp
directly instead of using one of these decoders.
Compose after any decoder that returns bytes. Text interpretation is explicit and rejects malformed UTF-8 rather than replacing bytes.
Preserve any RESP2 value, including a Redis error reply.
Decode a required bulk-string reply.
bulk_or_null : Resp -> Try(OptionalBytes, Error)
Decode a bulk string or RESP null, as returned by commands such as GET.
Decode an integer reply without narrowing its signed RESP2 range.
integer_boolean : Resp -> Try(Bool, Error)
Decode Redis's conventional integer boolean (0 or 1) strictly.
Decode any simple-string reply as binary bytes.
Require Redis's exact +OK status reply.
Decode an array without imposing a schema on its elements.
array_or_null : Resp -> Try(OptionalArray, Error)
Decode an array or RESP null, as returned by blocking collection commands.
optional_bulk_array : Resp -> Try(List(OptionalBytes), Error)
Decode an array whose elements are bulk strings or nulls, such as MGET.
ErrorClass : [Generic, WrongType, Moved, Ask, NoAuth, WrongPass, NoPermission, Busy, Loading, ReadOnly, OutOfMemory, ClusterDown, TryAgain, ExecAbort, NoScript, Unknown(Bytes)]
Error prefixes are Redis conventions, not RESP syntax. Unknown prefixes stay binary-safe; the original error bytes remain in Execute.ServerError.
Expected : [
ArrayOrNullReply,
ArrayReply,
BulkOrNullReply,
BulkReply,
IntegerBooleanReply,
IntegerReply,
OkayReply,
OptionalBulkArrayReply,
SimpleReply,
]
UnexpectedReply retains the complete actual value for diagnostics. Map errors to a compact application-owned summary before storing or queueing them long-term; retaining this error can keep large reply trees alive.
Optional : [Absent, Present(value)]
OptionalArray : Optional(List(Resp))
OptionalBytes : Optional(List(U8))