summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-12-31 09:00:21 +0200
committerLars Wirzenius <liw@liw.fi>2021-12-31 12:10:10 +0200
commitacf1ba3f8f1492b961c9a6eb09eb93e882f5eb3f (patch)
tree1ce0288f878cac71990bb01f358d6035f1626c92 /src/error.rs
parent686e87981db210fa443404c8473dfe7a3f39b241 (diff)
downloadobnam2-acf1ba3f8f1492b961c9a6eb09eb93e882f5eb3f.tar.gz
docs: add documentation comments to crate
Also, make it an error for a public symbol to not be documented. Sponsored-by: author
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs
index 30571ec..e8f5ee8 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -1,3 +1,5 @@
+//! Errors from Obnam client.
+
use crate::backup_run::BackupError;
use crate::cipher::CipherError;
use crate::client::ClientError;
@@ -12,47 +14,64 @@ use tempfile::PersistError;
/// Define all the kinds of errors that functions corresponding to
/// subcommands of the main program can return.
+///
+/// This collects all kinds of errors the Obnam client may get, for
+/// convenience.
#[derive(Debug, thiserror::Error)]
pub enum ObnamError {
+ /// Error listing generations on server.
#[error(transparent)]
GenerationListError(#[from] GenerationListError),
+ /// Error saving passwords.
#[error("couldn't save passwords to {0}: {1}")]
PasswordSave(PathBuf, PasswordError),
+ /// Error using server HTTP API.
#[error(transparent)]
ClientError(#[from] ClientError),
+ /// Error in client configuration.
#[error(transparent)]
ClientConfigError(#[from] ClientConfigError),
+ /// Error making a backup.
#[error(transparent)]
BackupError(#[from] BackupError),
+ /// Error making a new backup generation.
#[error(transparent)]
NascentError(#[from] NascentError),
+ /// Error encrypting or decrypting.
#[error(transparent)]
CipherError(#[from] CipherError),
+ /// Error using local copy of existing backup generation.
#[error(transparent)]
LocalGenerationError(#[from] LocalGenerationError),
+ /// Error restoring a backup.
#[error(transparent)]
RestoreError(#[from] RestoreError),
+ /// Error making temporary file persistent.
#[error(transparent)]
PersistError(#[from] PersistError),
+ /// Error doing I/O.
#[error(transparent)]
IoError(#[from] std::io::Error),
+ /// Error reading system clock.
#[error(transparent)]
SystemTimeError(#[from] SystemTimeError),
+ /// Error regarding JSON.
#[error(transparent)]
SerdeJsonError(#[from] serde_json::Error),
+ /// Unexpected cache directories found.
#[error(
"found CACHEDIR.TAG files that aren't present in the previous backup, might be an attack"
)]