#[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>
impl Eq for ErrorCode
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.
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnsafeUnpin for ErrorCode
impl UnwindSafe for ErrorCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.