summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs
index 89a10c1..8db0991 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -62,6 +62,22 @@ pub enum JournalError {
#[error("failed to stat draft in {0}: {1}")]
StatDraft(PathBuf, #[source] std::io::Error),
+ /// Error spawning git.
+ #[error("failed to start git in {0}: {1}")]
+ SpawnGit(PathBuf, std::io::Error),
+
+ /// Git init failed.
+ #[error("git init failed in {0}: {1}")]
+ GitInit(PathBuf, String),
+
+ /// Git add failed.
+ #[error("git add failed in {0}: {1}")]
+ GitAdd(PathBuf, String),
+
+ /// Git commit failed.
+ #[error("git commit failed in {0}: {1}")]
+ GitCommit(PathBuf, String),
+
/// Error spawning editor.
#[error("failed to start editor {0}: {1}")]
SpawnEditor(PathBuf, #[source] std::io::Error),
@@ -77,4 +93,8 @@ pub enum JournalError {
/// Failed to render a Tera template.
#[error("template {0} failed to render: {1}")]
TemplateRender(String, #[source] tera::Error),
+
+ /// Failed to make a path relative to a directory.
+ #[error("failed to make {0} relative to {1}: {2}")]
+ RelativePath(PathBuf, PathBuf, std::path::StripPrefixError),
}