1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
use sos_core::{AccountId, VaultId};
use std::path::PathBuf;
use thiserror::Error;
/// Errors generated by the server storage library.
#[derive(Debug, Error)]
pub enum Error {
/// Error generated when a directory is expected.
#[error("path '{0}' is not a directory")]
NotDirectory(PathBuf),
/// Error generated if we could not determine a cache directory.
#[error("could not determine cache directory")]
NoCache,
/// Error generated if we could not find a login folder for an account.
#[error("could not find login folder for '{0}'")]
NoLoginFolder(AccountId),
/// Error generated if we could not find a create vault event
/// in a collection of event records or as the first event in
/// a folder event log.
#[error("could not find create vault event")]
NoVaultEvent,
/// Error generated when vault identifiers must match.
#[error("identifier '{0}' does not match '{1}'")]
VaultIdentifierMismatch(VaultId, VaultId),
/// Errors generated by the core library.
#[error(transparent)]
Core(#[from] sos_core::Error),
/// Errors generated by the backend library.
#[error(transparent)]
Backend(#[from] sos_backend::Error),
/// Errors generated by the filesystem library.
#[error(transparent)]
FileSystem(#[from] sos_filesystem::Error),
/// Errors generated by the vault library.
#[error(transparent)]
Vault(#[from] sos_vault::Error),
/// Errors generated by the protocol library.
#[error(transparent)]
Protocol(#[from] sos_protocol::Error),
/// Errors generated by the sync library.
#[error(transparent)]
Sync(#[from] sos_sync::Error),
/// Errors generated by the backend storage.
#[error(transparent)]
BackendStorage(#[from] sos_backend::StorageError),
/// Errors generated by the database library.
#[error(transparent)]
Database(#[from] sos_database::Error),
/// Errors generated by the SQL library.
#[error(transparent)]
Sql(#[from] sos_database::async_sqlite::Error),
/// Errors generated by the IO module.
#[error(transparent)]
Io(#[from] std::io::Error),
}