diff options
author | Daniel Silverstone <dsilvers+gitlab@digital-scurf.org> | 2021-04-06 09:06:56 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers+gitlab@digital-scurf.org> | 2021-04-06 09:06:56 +0000 |
commit | 518e7dc2d5f97387702af0a300cc2842bd0deec6 (patch) | |
tree | 05b1bdaff3e35e31ca18fb98f472eacd2767d421 /src/error.rs | |
parent | cdb2ab3244776d99656b3aee93256a358456bf7e (diff) | |
parent | bd6b9363cf282e82267fb7108320a6571e7a3e24 (diff) | |
download | jt2-518e7dc2d5f97387702af0a300cc2842bd0deec6.tar.gz |
Merge branch 'no-anyhow-in-lib' into 'main'
refactor: use Result<_, JournalError> instead of anyhow::Result
See merge request larswirzenius/jt!10
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs index 05bb74d..199d1e4 100644 --- a/src/error.rs +++ b/src/error.rs @@ -26,6 +26,14 @@ pub enum JournalError { #[error("failed to create journal directory {0}")] CreateDirectory(PathBuf, #[source] std::io::Error), + /// Failed to rename entry when finishing it. + #[error("failed to rename journal entry {0} to {1}: {2}")] + RenameEntry(PathBuf, PathBuf, #[source] std::io::Error), + + /// Failed to write entry. + #[error("failed to create journal entry {0}: {1}")] + WriteEntry(PathBuf, #[source] std::io::Error), + /// To many drafts. #[error("there are already {0} drafts in {1}, can't create more")] TooManyDrafts(usize, PathBuf), |