pub struct AshError { /* private fields */ }Expand description
Main error type for ASH operations.
Error messages are designed to be safe for logging and client responses. They never contain sensitive data like payloads, proofs, or canonical strings.
Implementations§
Source§impl AshError
impl AshError
Sourcepub fn new(code: AshErrorCode, message: impl Into<String>) -> Self
pub fn new(code: AshErrorCode, message: impl Into<String>) -> Self
Create a new AshError.
Sourcepub fn code(&self) -> AshErrorCode
pub fn code(&self) -> AshErrorCode
Get the error code.
Sourcepub fn http_status(&self) -> u16
pub fn http_status(&self) -> u16
Get the recommended HTTP status code.
Source§impl AshError
Convenience functions for creating common errors.
impl AshError
Convenience functions for creating common errors.
Sourcepub fn invalid_context() -> Self
pub fn invalid_context() -> Self
Context not found.
Sourcepub fn context_expired() -> Self
pub fn context_expired() -> Self
Context expired.
Sourcepub fn replay_detected() -> Self
pub fn replay_detected() -> Self
Replay detected.
Sourcepub fn integrity_failed() -> Self
pub fn integrity_failed() -> Self
Integrity check failed.
Sourcepub fn endpoint_mismatch() -> Self
pub fn endpoint_mismatch() -> Self
Endpoint mismatch.
Sourcepub fn canonicalization_failed(reason: &str) -> Self
pub fn canonicalization_failed(reason: &str) -> Self
Canonicalization failed.
Trait Implementations§
Source§impl Error for AshError
impl Error for AshError
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()
Auto Trait Implementations§
impl Freeze for AshError
impl RefUnwindSafe for AshError
impl Send for AshError
impl Sync for AshError
impl Unpin for AshError
impl UnwindSafe for AshError
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