Initial Tessera backup vault (M0–M2)
Scaffold Rust workspace, React canvas, vault engine, hub API, providers, agent wormhole path, and Docker compose per SPEC.
This commit is contained in:
33
crates/tessera-core/src/errors.rs
Normal file
33
crates/tessera-core/src/errors.rs
Normal file
@@ -0,0 +1,33 @@
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum TesseraError {
|
||||
#[error("vault is locked: {0}")]
|
||||
VaultLocked(String),
|
||||
#[error("wrong passphrase")]
|
||||
WrongPassphrase,
|
||||
#[error("provider unreachable: {0}")]
|
||||
ProviderUnreachable(String),
|
||||
#[error("disk full: need {needed} bytes")]
|
||||
DiskFull { needed: u64 },
|
||||
#[error("{0}")]
|
||||
UserMessage(String),
|
||||
}
|
||||
|
||||
impl TesseraError {
|
||||
pub fn user_message(&self) -> &str {
|
||||
match self {
|
||||
TesseraError::VaultLocked(_) => {
|
||||
"Another orbit is still circling the vault. Try again when it finishes."
|
||||
}
|
||||
TesseraError::WrongPassphrase => "That key doesn't unlock this vault.",
|
||||
TesseraError::ProviderUnreachable(_) => {
|
||||
"We couldn't reach the source at this outpost."
|
||||
}
|
||||
TesseraError::DiskFull { .. } => {
|
||||
"The vault is out of space—free room or widen the hold."
|
||||
}
|
||||
TesseraError::UserMessage(m) => m.as_str(),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user