diff options
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/src/error.rs b/src/error.rs index f9608a8..f0d76e3 100644 --- a/src/error.rs +++ b/src/error.rs @@ -259,16 +259,29 @@ pub enum SubplotError { #[error("no scenarios were found matching the `{0}` template")] NoScenariosMatched(String), - /// I/O error - /// - /// Subplot did some I/O, and it failed. This is a generic wrapper - /// for any kind of I/O error. - #[error(transparent)] - IoError { - /// The wrapped error. - #[from] - source: std::io::Error, - }, + /// Failed to invoke a program. + #[error("Failed to invoke {0}")] + Spawn(PathBuf, #[source] std::io::Error), + + /// Failed to write to stdin of child process. + #[error("Failed to write to stdin of child process")] + WriteToChild(#[source] std::io::Error), + + /// Error when waiting for child process to finish. + #[error("Error when waiting for child process to finish")] + WaitForChild(#[source] std::io::Error), + + /// Error when reading a file. + #[error("Error when reading {0}")] + ReadFile(PathBuf, #[source] std::io::Error), + + /// Error when creating a file. + #[error("Error when creating {0}")] + CreateFile(PathBuf, #[source] std::io::Error), + + /// Error when writing to a file. + #[error("Error when writing to {0}")] + WriteFile(PathBuf, #[source] std::io::Error), /// Pandoc error /// |