summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/error.rs b/src/error.rs
index 6e7eddd..13d6a6c 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -342,7 +342,7 @@ 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, thiserror::Error)]
+#[derive(Debug, Clone, thiserror::Error)]
pub enum Warning {
/// Document refers to an embedded file that doesn't exist.
#[error(
@@ -357,6 +357,10 @@ pub enum Warning {
/// Missing step implementation.
#[error("Missing step implementation: \"{1}\"\n in scenario \"{0}\"")]
MissingStepImplementation(String, String),
+
+ /// Unknown binding when typesetting a scenario.
+ #[error("Unknown binding: {0}")]
+ UnknownBinding(String),
}
/// A list of warnings.
@@ -374,6 +378,11 @@ impl Warnings {
self.warnings.push(w);
}
+ /// Append all warnings from one list to another.
+ pub fn push_all(&mut self, mut other: Warnings) {
+ self.warnings.append(&mut other.warnings);
+ }
+
/// Return a slice with all the warnings in the list.
pub fn warnings(&self) -> &[Warning] {
&self.warnings