1use sos_core::{commit::CommitHash, VaultId};
2use thiserror::Error;
3
4#[derive(Debug, Error)]
6pub enum Error {
7 #[error("folder '{0}' not found in the database")]
9 DatabaseFolderNotFound(VaultId),
10
11 #[error("login folder not found for account id '{0}'")]
13 NoLoginFolder(i64),
14
15 #[error("commit '{0}' could not be found")]
17 CommitNotFound(CommitHash),
18
19 #[error("checkpoint verification failed, expected root hash '{checkpoint}' but computed '{computed}')")]
23 CheckpointVerification {
24 checkpoint: CommitHash,
26 computed: CommitHash,
28 },
29
30 #[error(transparent)]
32 Core(#[from] sos_core::Error),
33
34 #[error(transparent)]
36 Vault(#[from] sos_vault::Error),
37
38 #[error(transparent)]
40 TryFromSlice(#[from] std::array::TryFromSliceError),
41
42 #[error(transparent)]
44 TryFromInt(#[from] std::num::TryFromIntError),
45
46 #[error(transparent)]
48 Uuid(#[from] uuid::Error),
49
50 #[error(transparent)]
52 Io(#[from] std::io::Error),
53
54 #[error(transparent)]
56 Json(#[from] serde_json::Error),
57
58 #[error(transparent)]
60 UrlParse(#[from] url::ParseError),
61
62 #[error(transparent)]
64 Refinery(#[from] refinery::Error),
65
66 #[error(transparent)]
68 AsyncSqlite(#[from] async_sqlite::Error),
69
70 #[error(transparent)]
72 Rusqlite(#[from] async_sqlite::rusqlite::Error),
73
74 #[cfg(feature = "system-messages")]
75 #[error(transparent)]
77 Urn(#[from] urn::Error),
78}