pub enum InfrastructureErrorCode {
Show 15 variants
InternalError,
ValidationFailed,
NotFound,
Conflict,
Unauthorized,
Forbidden,
Gone,
DatabaseError,
SerializationError,
AggregateNotFound,
ConcurrencyError,
DomainError,
CqrsInternalError,
ConfigurationError,
Unknown,
}Expand description
Error codes for infrastructure/technical errors.
These are used when converting from low-level errors. Domain-specific errors should use their own error codes instead.
Variants§
InternalError
ValidationFailed
NotFound
Conflict
Forbidden
Gone
DatabaseError
SerializationError
AggregateNotFound
ConcurrencyError
DomainError
CqrsInternalError
ConfigurationError
Unknown
Trait Implementations§
Source§impl Clone for InfrastructureErrorCode
impl Clone for InfrastructureErrorCode
Source§fn clone(&self) -> InfrastructureErrorCode
fn clone(&self) -> InfrastructureErrorCode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl CqrsErrorCode for InfrastructureErrorCode
impl CqrsErrorCode for InfrastructureErrorCode
Source§fn domain_prefix() -> u16
fn domain_prefix() -> u16
Domain prefix for internal codes (0-9)
Each domain gets a unique prefix.
Source§fn error_index(&self) -> u16
fn error_index(&self) -> u16
Unique error index within the domain (0-999)
Source§fn http_status(&self) -> StatusCode
fn http_status(&self) -> StatusCode
HTTP status code for this error
Source§fn internal_code(&self) -> u16
fn internal_code(&self) -> u16
Full internal code: domain_prefix * 1000 + error_index
Example: Tenant (4) + NotFound (1) = 4001
Source§fn code_string(&self) -> String
fn code_string(&self) -> String
String representation of the error code for JSON serialization
Format: DOMAIN_ERROR_NAME (e.g., “PLAN_NOT_FOUND”)
Source§impl Debug for InfrastructureErrorCode
impl Debug for InfrastructureErrorCode
Source§impl Display for InfrastructureErrorCode
impl Display for InfrastructureErrorCode
Source§impl Error for InfrastructureErrorCode
impl Error for InfrastructureErrorCode
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for InfrastructureErrorCode
impl PartialEq for InfrastructureErrorCode
Source§fn eq(&self, other: &InfrastructureErrorCode) -> bool
fn eq(&self, other: &InfrastructureErrorCode) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for InfrastructureErrorCode
impl Eq for InfrastructureErrorCode
impl StructuralPartialEq for InfrastructureErrorCode
Auto Trait Implementations§
impl Freeze for InfrastructureErrorCode
impl RefUnwindSafe for InfrastructureErrorCode
impl Send for InfrastructureErrorCode
impl Sync for InfrastructureErrorCode
impl Unpin for InfrastructureErrorCode
impl UnsafeUnpin for InfrastructureErrorCode
impl UnwindSafe for InfrastructureErrorCode
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
Mutably borrows from an owned value. Read more