summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/error.rs b/src/error.rs
index 31fca60..6e7eddd 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -8,6 +8,10 @@ use thiserror::Error;
/// Define all the kinds of errors any part of this crate can return.
#[derive(Debug, Error)]
pub enum SubplotError {
+ /// Document has non-fatal errors.
+ #[error("Document has {0} warnings.")]
+ Warnings(usize),
+
/// Subplot could not find a file named as a bindings file.
#[error("binding file could not be found: {0}: {1}")]
BindingsFileNotFound(PathBuf, std::io::Error),
@@ -338,16 +342,21 @@ pub type Result<T> = std::result::Result<T, SubplotError>;
/// A warning, or non-fatal error.
///
/// Errors prevent Subplot from producing output. Warnings don't do that.
-#[derive(Debug)]
+#[derive(Debug, thiserror::Error)]
pub enum Warning {
/// Document refers to an embedded file that doesn't exist.
- UnknownEmbeddedFile(String),
+ #[error(
+ "Document refers to an embedded file that doesn't exist: \"{1}\"\n in scenario \"{0}\""
+ )]
+ UnknownEmbeddedFile(String, String),
/// Embedded file is not used by any scenario.
+ #[error("Embedded file is not used by any scenario: \"{0}\"")]
UnusedEmbeddedFile(String),
/// Missing step implementation.
- MissingStepImplementation(String),
+ #[error("Missing step implementation: \"{1}\"\n in scenario \"{0}\"")]
+ MissingStepImplementation(String, String),
}
/// A list of warnings.