#[non_exhaustive]pub enum VaultError {
Show 18 variants
CryptoError(String),
AuthenticationFailed,
IntegrityError(String),
VersionError(String),
ModelNotFound(String),
VersionNotFound(u32, String),
NotFound(String),
ConversionError(String),
UnsupportedFormat(String),
IoError(Error),
ConfigError(String),
SerializationError(String),
CompressionError(String),
SecurityViolation(String),
ComplianceViolation(String),
AuditError(String),
InvalidInput(String),
StorageError(String),
}Expand description
AI Model Vault error types
Marked #[non_exhaustive] so that adding a category later is not a breaking
change for downstream matches. Inside this crate the enum is still
exhaustive, which is what forces VaultError::exit_code to assign every
new variant a code rather than letting it fall through a wildcard — the
omission that let the published exit-code tables drift from reality.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
CryptoError(String)
Cryptographic operation failed
AuthenticationFailed
Invalid passphrase or authentication failure
IntegrityError(String)
Data integrity check failed
VersionError(String)
Version control error
ModelNotFound(String)
Model not found
VersionNotFound(u32, String)
Version not found
NotFound(String)
A named resource that is not a model or a version does not exist — a profile, a registered vault, a backup schedule, a document.
Carries a full message rather than a bare name so the caller can say which kind of thing was missing.
ConversionError(String)
Format conversion error
UnsupportedFormat(String)
Unsupported model format
IoError(Error)
I/O error
ConfigError(String)
Configuration error
SerializationError(String)
Serialization error
CompressionError(String)
Compression error
SecurityViolation(String)
Security policy violation
ComplianceViolation(String)
Compliance violation
AuditError(String)
Audit log error
InvalidInput(String)
Invalid input
StorageError(String)
Storage/database error
Implementations§
Source§impl VaultError
impl VaultError
Sourcepub fn exit_code(&self) -> u8
pub fn exit_code(&self) -> u8
The process exit code this error maps to.
This is a stability contract: agents and CI pipelines branch on
these numbers, so the mapping from category to code must not change
once published. It is mirrored in README.md, AGENTS.md,
docs/CLI.md, .well-known/agents.json, and
.well-known/ontology.jsonld — change all of them together, and only
ever by assigning a new code to a category that had none.
Codes 0–5 match the table those manifests already published. 6–8 are
additions for categories that previously fell through to 1.
IoError is split: the kernel refusing access is a distinct,
actionable outcome (fix the permissions) from a disk or network
failure, so PermissionDenied earns EXIT_PERMISSION while every
other I/O failure stays EXIT_GENERAL.
Sourcepub fn kind(&self) -> &'static str
pub fn kind(&self) -> &'static str
Stable, constant name for the error variant.
This exists so telemetry can report which kind of failure occurred
without touching the message. Every variant that carries a String
carries an interpolated one — model names, filesystem paths, and in
ConfigError’s case the path of a config file under the user’s home
directory. Display output is therefore unsafe to report, and this
returns a fixed literal per variant instead: the set of possible values
is exactly the list below, and nothing else can ever appear.
Trait Implementations§
Source§impl Debug for VaultError
impl Debug for VaultError
Source§impl Display for VaultError
impl Display for VaultError
Source§impl Error for VaultError
impl Error for VaultError
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()
Source§impl From<ConversionError> for VaultError
impl From<ConversionError> for VaultError
Source§fn from(err: ConversionError) -> Self
fn from(err: ConversionError) -> Self
Source§impl From<CryptoError> for VaultError
impl From<CryptoError> for VaultError
Source§fn from(err: CryptoError) -> Self
fn from(err: CryptoError) -> Self
Source§impl From<Error> for VaultError
impl From<Error> for VaultError
Source§impl From<Error> for VaultError
impl From<Error> for VaultError
Source§impl From<Error> for VaultError
impl From<Error> for VaultError
Source§impl From<StorageError> for VaultError
impl From<StorageError> for VaultError
Source§fn from(err: StorageError) -> Self
fn from(err: StorageError) -> Self
Source§impl From<VaultError> for ApiError
impl From<VaultError> for ApiError
Source§fn from(err: VaultError) -> Self
fn from(err: VaultError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for VaultError
impl !UnwindSafe for VaultError
impl Freeze for VaultError
impl Send for VaultError
impl Sync for VaultError
impl Unpin for VaultError
impl UnsafeUnpin for VaultError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request