diff options
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs index 00dae56..232eaec 100644 --- a/src/error.rs +++ b/src/error.rs @@ -25,4 +25,24 @@ pub enum JournalError { /// Failed to create the directory for the journal. #[error("failed to create journal directory {0}")] CreateDirectory(PathBuf, #[source] std::io::Error), + + /// To many drafts. + #[error("there are already {0} drafts in {1}, can't create more")] + TooManyDrafts(usize, PathBuf), + + /// User chose a draft that doesn't exist. + #[error("No draft {0} in {1}")] + NoSuchDraft(String, PathBuf), + + /// Failed to read draft. + #[error("failed to drafts {0}: {1}")] + ReadDraft(PathBuf, #[source] std::io::Error), + + /// Draft is not UTF8. + #[error("draft {0} is not UTF8: {1}")] + DraftNotUUtf8(PathBuf, #[source] std::string::FromUtf8Error), + + /// Failed to get metadata for specific file in drafts folder. + #[error("failed to stat draft in {0}: {1}")] + StatDraft(PathBuf, #[source] std::io::Error), } |