#[non_exhaustive]pub enum ErrorCode {
BadRequest,
EnrollmentFailed,
NotApproved,
Forbidden,
CertificateError,
InternalError,
SequenceError,
Other(String),
}Expand description
Machine-readable error code sent in ErrorPayload.
§Wire forward-compatibility
Other(String) is a catch-all for error codes received from a newer
controller that this build does not yet recognise. Serde deserialization
is infallible: an unknown string becomes Other(...) rather than a parse
error, allowing older agents to survive rolling upgrades without dropping
the enclosing Error message.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BadRequest
Malformed or unexpected message from the service.
EnrollmentFailed
Enrollment attempt failed on the controller side.
NotApproved
Service is not approved (pending or rejected).
Forbidden
Service is not allowed to perform this action.
CertificateError
Certificate signing or renewal error.
InternalError
Unrecoverable server-side error.
SequenceError
Message sequence number mismatch (replay protection).
Other(String)
An unknown error code received from a newer peer.
The inner string is the raw snake_case value as it appeared on the wire.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ErrorCode
impl<'de> Deserialize<'de> for ErrorCode
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Source§impl From<String> for ErrorCode
impl From<String> for ErrorCode
Source§fn from(s: String) -> Self
fn from(s: String) -> Self
Converts a snake_case string to an error code.
Unknown strings map to ErrorCode::Other rather than failing.