start working on generalizing credential logic
This commit is contained in:
@@ -127,10 +127,10 @@ pub enum SetupError {
|
||||
InvalidRecord, // e.g. wrong size blob for nonce or salt
|
||||
#[error("Error from database: {0}")]
|
||||
DbError(#[from] SqlxError),
|
||||
#[error("Error loading data: {0}")]
|
||||
KvError(#[from] LoadKvError),
|
||||
#[error("Error running migrations: {0}")]
|
||||
MigrationError(#[from] MigrateError),
|
||||
#[error("Error parsing configuration from database")]
|
||||
ConfigParseError(#[from] serde_json::Error),
|
||||
#[error("Failed to set up start-on-login: {0}")]
|
||||
AutoLaunchError(#[from] auto_launch::Error),
|
||||
#[error("Failed to start listener: {0}")]
|
||||
@@ -251,6 +251,38 @@ pub enum LockError {
|
||||
Setup(#[from] SetupError),
|
||||
#[error(transparent)]
|
||||
TauriError(#[from] tauri::Error),
|
||||
#[error(transparent)]
|
||||
Crypto(#[from] CryptoError),
|
||||
}
|
||||
|
||||
|
||||
#[derive(Debug, ThisError, AsRefStr)]
|
||||
pub enum SaveCredentialsError {
|
||||
#[error("Database error: {0}")]
|
||||
DbError(#[from] SqlxError),
|
||||
#[error("Encryption error: {0}")]
|
||||
Encryption(#[from] chacha20poly1305::Error),
|
||||
}
|
||||
|
||||
#[derive(Debug, ThisError, AsRefStr)]
|
||||
pub enum LoadCredentialsError {
|
||||
#[error("Database error: {0}")]
|
||||
DbError(#[from] SqlxError),
|
||||
#[error("Encryption error: {0}")]
|
||||
Encryption(#[from] chacha20poly1305::Error),
|
||||
#[error("Credentials not found")]
|
||||
NoCredentials,
|
||||
#[error("Could not decode credentials: {0}")]
|
||||
Invalid(#[from] serde_json::Error),
|
||||
}
|
||||
|
||||
|
||||
#[derive(Debug, ThisError, AsRefStr)]
|
||||
pub enum LoadKvError {
|
||||
#[error("Database error: {0}")]
|
||||
DbError(#[from] SqlxError),
|
||||
#[error("Could not parse value from database: {0}")]
|
||||
Invalid(#[from] serde_json::Error),
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user