pub enum ErrorCode {
Show 27 variants
LicenseNotFound,
LicenseExpired,
LicenseRevoked,
LicenseSuspended,
LicenseBlacklisted,
LicenseInactive,
AlreadyBound,
NotBound,
HardwareMismatch,
FeatureNotIncluded,
QuotaExceeded,
InvalidRequest,
MissingField,
InvalidField,
MissingToken,
InvalidHeader,
InvalidToken,
TokenExpired,
InsufficientScope,
AuthDisabled,
NotFound,
Conflict,
DatabaseError,
ConfigError,
CryptoError,
NetworkError,
InternalError,
}Expand description
Machine-readable error codes for API responses.
These codes are stable and can be used by clients for programmatic error handling.
Variants§
LicenseNotFound
License key was not found in the database
LicenseExpired
License has expired
LicenseRevoked
License has been revoked
LicenseSuspended
License is suspended (temporary)
LicenseBlacklisted
License has been permanently blacklisted
LicenseInactive
License exists but is not in active state
AlreadyBound
License is already bound to a different device
NotBound
License is not bound to any device
HardwareMismatch
Request hardware ID doesn’t match bound device
FeatureNotIncluded
Requested feature is not included in license tier
QuotaExceeded
Usage quota has been exceeded
InvalidRequest
Request payload is invalid or malformed
MissingField
A required field is missing
InvalidField
A field value is invalid
MissingToken
No authentication token provided
InvalidHeader
Authorization header is malformed
InvalidToken
Authentication token is invalid
TokenExpired
Authentication token has expired
InsufficientScope
Token lacks required permissions
AuthDisabled
Authentication is not configured on server
NotFound
Requested resource was not found
Conflict
Operation conflicts with current state
DatabaseError
Database operation failed
ConfigError
Server configuration error
CryptoError
Encryption/decryption operation failed
NetworkError
External service communication failed
InternalError
Unexpected internal server error
Implementations§
Source§impl ErrorCode
impl ErrorCode
Sourcepub fn status_code(&self) -> StatusCode
pub fn status_code(&self) -> StatusCode
Returns the HTTP status code for this error code.
Sourcepub fn default_message(&self) -> &'static str
pub fn default_message(&self) -> &'static str
Returns a default human-readable message for this error code.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ErrorCode
impl<'de> Deserialize<'de> for ErrorCode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<ClientErrorCode> for ErrorCode
impl From<ClientErrorCode> for ErrorCode
Source§fn from(code: ClientErrorCode) -> Self
fn from(code: ClientErrorCode) -> Self
impl Copy for ErrorCode
impl Eq for ErrorCode
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 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,
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.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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more