#[non_exhaustive]#[repr(u32)]pub enum ErrorCode {
Ok = 0,
VersionMismatch = 1,
InvalidHeader = 2,
InvalidQuery = 3,
InvalidBody = 4,
ParseError = 5,
MethodNotFound = 6,
Timeout = 7,
ResourceExhausted = 8,
InternalError = 9,
ApplicationErrorBase = 4_096,
}Expand description
REPE high-level error codes.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Ok = 0
Success. The response carries a normal result, not an error.
VersionMismatch = 1
The request’s REPE version is not supported by this server.
InvalidHeader = 2
The fixed header was malformed: bad spec magic, wrong length, or a length that disagrees with the body.
InvalidQuery = 3
The query was malformed or used a query format this server does not accept (e.g. a raw-binary query against a JSON-pointer router).
InvalidBody = 4
The body could not be interpreted for the target method (wrong shape or type for what the handler expected).
ParseError = 5
The message could not be parsed: a framing, header-decode, or body-decode failure below the application level.
MethodNotFound = 6
No handler is registered for the requested query path.
Timeout = 7
The request did not produce a response within the allotted time.
ResourceExhausted = 8
The server is temporarily unable to service the request and the
client should retry. Distinct from an application error: it
signals transient saturation, not a failed result. The built-in
WebSocketServer returns this when an off-reader request is
rejected because the per-connection with_offreader_limit cap is
reached. Occupies the REPE-reserved 8..4095 range (between
Timeout and ApplicationErrorBase).
InternalError = 9
The server hit an unexpected internal failure while handling the
request; the result is not a normal application-level outcome.
The built-in WebSocketServer returns this for a caught
off-reader handler panic. Also in the REPE-reserved 8..4095
range.
ApplicationErrorBase = 4_096
Base of the application-defined error range. A handler returns this
(or any value at or above it) for an ordinary application-level
failure, as distinct from the protocol-level codes above and from
the ResourceExhausted / InternalError server conditions.
Trait Implementations§
impl Copy for ErrorCode
impl Eq for ErrorCode
Source§impl<'de> Read<'de> for ErrorCode
impl<'de> Read<'de> for ErrorCode
Source§impl<'de> ReadEnum<'de> for ErrorCode
impl<'de> ReadEnum<'de> for ErrorCode
Source§impl<'de> ReadEnum<'de> for ErrorCode
impl<'de> ReadEnum<'de> for ErrorCode
impl StructuralPartialEq for ErrorCode
Source§impl Write for ErrorCode
impl Write for ErrorCode
Source§const ARRAY: Option<&'static [u8]>
const ARRAY: Option<&'static [u8]>
None if it has no array form of its own and belongs in a generic one. Read more