pub enum EnvelopeError {
Show 16 variants
Config(String),
Io(String),
Json(String),
Validation(String),
NotFound {
entity_type: &'static str,
identifier: String,
},
Duplicate {
entity_type: &'static str,
identifier: String,
},
Budget(String),
Reconciliation(String),
Import(String),
Export(String),
Encryption(String),
Locked(String),
InsufficientFunds {
category: String,
needed: i64,
available: i64,
},
Storage(String),
Tui(String),
Income(String),
}Expand description
The main error type for EnvelopeCLI operations
Variants§
Config(String)
Configuration-related errors
Io(String)
File I/O errors
Json(String)
JSON serialization/deserialization errors
Validation(String)
Validation errors for data models
NotFound
Entity not found errors
Duplicate
Duplicate entity errors
Budget(String)
Budget-related errors
Reconciliation(String)
Reconciliation errors
Import(String)
Import errors
Export(String)
Export errors
Encryption(String)
Encryption errors
Locked(String)
Transaction is locked (reconciled)
InsufficientFunds
Insufficient funds
Storage(String)
Storage errors
Tui(String)
TUI errors
Income(String)
Income expectation errors
Implementations§
Source§impl EnvelopeError
impl EnvelopeError
Sourcepub fn account_not_found(identifier: impl Into<String>) -> Self
pub fn account_not_found(identifier: impl Into<String>) -> Self
Create a “not found” error for accounts
Sourcepub fn category_not_found(identifier: impl Into<String>) -> Self
pub fn category_not_found(identifier: impl Into<String>) -> Self
Create a “not found” error for categories
Sourcepub fn transaction_not_found(identifier: impl Into<String>) -> Self
pub fn transaction_not_found(identifier: impl Into<String>) -> Self
Create a “not found” error for transactions
Sourcepub fn payee_not_found(identifier: impl Into<String>) -> Self
pub fn payee_not_found(identifier: impl Into<String>) -> Self
Create a “not found” error for payees
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Check if this is a “not found” error
Sourcepub fn is_validation(&self) -> bool
pub fn is_validation(&self) -> bool
Check if this is a validation error
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Check if this is a recoverable error (can retry)
Sourcepub fn user_message(&self) -> String
pub fn user_message(&self) -> String
Get a user-friendly message for this error
Sourcepub fn recovery_suggestions(&self) -> Vec<&'static str>
pub fn recovery_suggestions(&self) -> Vec<&'static str>
Get recovery suggestions for this error
Trait Implementations§
Source§impl Debug for EnvelopeError
impl Debug for EnvelopeError
Source§impl Display for EnvelopeError
impl Display for EnvelopeError
Source§impl Error for EnvelopeError
impl Error for EnvelopeError
1.30.0 · 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
Source§impl From<Error> for EnvelopeError
impl From<Error> for EnvelopeError
Auto Trait Implementations§
impl Freeze for EnvelopeError
impl RefUnwindSafe for EnvelopeError
impl Send for EnvelopeError
impl Sync for EnvelopeError
impl Unpin for EnvelopeError
impl UnwindSafe for EnvelopeError
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
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> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more