summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-05-09 09:34:36 +0300
committerLars Wirzenius <liw@liw.fi>2020-05-09 11:07:37 +0300
commita21ba1f5fcc9b03f7657c5b00c4c215286b06341 (patch)
treea64b77067ca53d8cf32482b8ab1b64ad7687f711 /src/error.rs
parentaefd93fb14b4781deca481d2a21953c9fd30f361 (diff)
downloadsubplot-a21ba1f5fcc9b03f7657c5b00c4c215286b06341.tar.gz
Change: keep actual text of keyword from scenario
The typesetting should preserve the actual keyword or alias in the source. Previously, if source had this: ``` given foo and bar ``` it got typeset as if were: ``` given foo given bar ``` Also, change subplot.md to use alias when possible.
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/error.rs b/src/error.rs
index 3d28d3b..0a79cf6 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -89,15 +89,19 @@ pub enum SubplotError {
#[error("first scenario is before first heading")]
ScenarioBeforeHeading,
- /// Unknown scenario step keyword
+ /// Step does not have a keyword.
+ #[error("step has no keyword: {0}")]
+ NoStepKeyword(String),
+
+ /// Unknown scenario step keyword.
///
/// Each scenario step must start with a known keyword (given,
/// when, then, and, but), but Subplot didn't find one it
/// recognized.
///
/// This is usually due to a typing mistake or similar.
- #[error("unknown step keyword")]
- UnknownStepKind,
+ #[error("unknown step keyword: {0}")]
+ UnknownStepKind(String),
/// Scenario step uses continuation keyword too early
///