get backend running
This commit is contained in:
@@ -208,6 +208,12 @@ pub enum GetCredentialsError {
|
||||
Locked,
|
||||
#[error("No credentials are known")]
|
||||
Empty,
|
||||
#[error(transparent)]
|
||||
Crypto(#[from] CryptoError),
|
||||
#[error(transparent)]
|
||||
Load(#[from] LoadCredentialsError),
|
||||
#[error(transparent)]
|
||||
GetSession(#[from] GetSessionError),
|
||||
}
|
||||
|
||||
|
||||
@@ -245,8 +251,8 @@ pub enum UnlockError {
|
||||
pub enum LockError {
|
||||
#[error("App is not unlocked")]
|
||||
NotUnlocked,
|
||||
#[error("Database error: {0}")]
|
||||
DbError(#[from] SqlxError),
|
||||
#[error(transparent)]
|
||||
LoadCredentials(#[from] LoadCredentialsError),
|
||||
#[error(transparent)]
|
||||
Setup(#[from] SetupError),
|
||||
#[error(transparent)]
|
||||
@@ -261,19 +267,23 @@ pub enum SaveCredentialsError {
|
||||
#[error("Database error: {0}")]
|
||||
DbError(#[from] SqlxError),
|
||||
#[error("Encryption error: {0}")]
|
||||
Encryption(#[from] chacha20poly1305::Error),
|
||||
Crypto(#[from] CryptoError),
|
||||
#[error(transparent)]
|
||||
Session(#[from] GetCredentialsError),
|
||||
}
|
||||
|
||||
#[derive(Debug, ThisError, AsRefStr)]
|
||||
pub enum LoadCredentialsError {
|
||||
#[error("Database error: {0}")]
|
||||
DbError(#[from] SqlxError),
|
||||
#[error("Encryption error: {0}")]
|
||||
Encryption(#[from] chacha20poly1305::Error),
|
||||
#[error("Invalid passphrase")] // pretty sure this is the only way decryption fails
|
||||
Encryption(#[from] CryptoError),
|
||||
#[error("Credentials not found")]
|
||||
NoCredentials,
|
||||
#[error("Could not decode credentials: {0}")]
|
||||
Invalid(#[from] serde_json::Error),
|
||||
#[error("Could not decode credential data")]
|
||||
InvalidData,
|
||||
#[error(transparent)]
|
||||
LoadKv(#[from] LoadKvError),
|
||||
}
|
||||
|
||||
|
||||
@@ -292,6 +302,10 @@ pub enum CryptoError {
|
||||
Argon2(#[from] argon2::Error),
|
||||
#[error("Invalid passphrase")] // I think this is the only way decryption fails
|
||||
Aead(#[from] chacha20poly1305::aead::Error),
|
||||
#[error("App is currently locked")]
|
||||
Locked,
|
||||
#[error("No passphrase has been specified")]
|
||||
Empty,
|
||||
}
|
||||
|
||||
|
||||
@@ -409,6 +423,8 @@ impl_serialize_basic!(GetCredentialsError);
|
||||
impl_serialize_basic!(ClientInfoError);
|
||||
impl_serialize_basic!(WindowError);
|
||||
impl_serialize_basic!(LockError);
|
||||
impl_serialize_basic!(SaveCredentialsError);
|
||||
impl_serialize_basic!(LoadCredentialsError);
|
||||
|
||||
|
||||
impl Serialize for HandlerError {
|
||||
|
Reference in New Issue
Block a user