#[non_exhaustive]pub enum Error {
UrlParse(ParseError),
InvalidUrl(String),
UnknownScheme(String),
UnsupportedOperation {
scheme: &'static str,
operation: &'static str,
},
NotFound(String),
PermissionDenied(String),
AuthenticationFailed(String),
PreconditionFailed(String),
Backend {
scheme: &'static str,
kind: BackendFailureKind,
message: String,
},
}Expand description
hasp library-surface errors. Stable across all backends; backend impls map their native error vocabulary into these variants.
This enum is intentionally flat so consumers can match on variants without string-matching nested SDK-style error hierarchies.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UrlParse(ParseError)
URL parse failure at the url crate layer (malformed URI).
InvalidUrl(String)
URL parsed but does not satisfy a backend-specific grammar rule (e.g. wrong path-segment count, missing required component).
UnknownScheme(String)
URL scheme is not registered in this Store.
UnsupportedOperation
Backend recognized the URL but does not implement the requested verb
(e.g. env:// does not support put).
NotFound(String)
The addressed secret does not exist.
PermissionDenied(String)
Caller’s credentials are valid; caller is not authorized for this resource.
AuthenticationFailed(String)
Caller’s credentials are missing, invalid, or expired.
PreconditionFailed(String)
Resource is in a state that blocks the operation, even though the caller has permission and the resource exists.
Backend
Backend-specific failure that does not fit a more-specific variant.
kind provides retry guidance; message carries diagnostic detail
(backend error code, HTTP status, sub-error). Never includes secret values.
Implementations§
Source§impl Error
impl Error
Sourcepub fn is_transient(&self) -> bool
pub fn is_transient(&self) -> bool
True if a retry has any chance of succeeding without external action.
Returns true for Backend { kind: Transient | Throttled, .. }.
Returns false for everything else, including NotFound,
PermissionDenied, AuthenticationFailed, PreconditionFailed.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()