pub enum ErrorCode {
InvalidInput,
AuthenticationRequired,
AccessDenied,
NotFound,
Conflict,
RateLimited,
CapacityExceeded,
DeadlineExceeded,
DependencyUnavailable,
IntegrityFailure,
InternalFailure,
}Expand description
Stable failure taxonomy shared across HTTP, CLI, jobs, and integration surfaces.
§Variants
InvalidInput: SupportedErrorCodevariant.AuthenticationRequired: SupportedErrorCodevariant.AccessDenied: SupportedErrorCodevariant.NotFound: SupportedErrorCodevariant.Conflict: SupportedErrorCodevariant.RateLimited: SupportedErrorCodevariant.CapacityExceeded: SupportedErrorCodevariant.DeadlineExceeded: SupportedErrorCodevariant.DependencyUnavailable: SupportedErrorCodevariant.IntegrityFailure: SupportedErrorCodevariant.InternalFailure: SupportedErrorCodevariant.
§Examples
ⓘ
let _ = pharos_runtime_core::error::ErrorCode::InvalidInput;§Related
crate::errorfor constructors, helpers, and neighboring runtime types.
Variants§
InvalidInput
AuthenticationRequired
AccessDenied
NotFound
Conflict
RateLimited
CapacityExceeded
DeadlineExceeded
IntegrityFailure
InternalFailure
Implementations§
Source§impl ErrorCode
impl ErrorCode
Sourcepub const fn from_exit_code(exit_code: i32) -> Self
pub const fn from_exit_code(exit_code: i32) -> Self
Maps a CLI exit code into the public error taxonomy.
§Examples
ⓘ
let _ = pharos_runtime_core::error::fn;§Related
crate::errorfor the surrounding module surface.
Sourcepub const fn from_http_status(status: u16) -> Self
pub const fn from_http_status(status: u16) -> Self
Maps an HTTP status code into the public error taxonomy.
§Examples
ⓘ
let _ = pharos_runtime_core::error::fn;§Related
crate::errorfor the surrounding module surface.
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
Returns the stable machine-readable error code.
§Examples
ⓘ
let _ = pharos_runtime_core::error::fn;§Related
crate::errorfor the surrounding module surface.
Sourcepub const fn http_status(self) -> u16
pub const fn http_status(self) -> u16
Returns the fail-closed HTTP status for this error class.
§Examples
ⓘ
let _ = pharos_runtime_core::error::fn;§Related
crate::errorfor the surrounding module surface.
Trait Implementations§
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 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.