mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-25 10:17:02 -06:00
CLI: a malformed JSON Lines entry names its step as well as its line (#3147)
Review follow-up (CodeRabbit): a line that wasn't valid JSON was reported by its line only, while every other --commands error names the run's step. It now says `step N (line L)`, N counted with the --cmd steps before it. run_refuses_malformed_commands_naming_the_step expects `step 2 (line 3)`; it fails without the change.
This commit is contained in:
committed by
bflatastic
parent
87fdd4a370
commit
49d69d48e5
@@ -386,7 +386,7 @@ fn parse_commands(source: &str, text: &str, first: usize) -> Result<Vec<Step>, S
|
||||
if entries.len() == MAX_COMMANDS_STEPS {
|
||||
return Err(too_many());
|
||||
}
|
||||
let v = serde_json::from_str(line).map_err(|e| format!("--commands {source}: line {}: {e}", n + 1))?;
|
||||
let v = serde_json::from_str(line).map_err(|e| format!("--commands {source}: step {} (line {}): {e}", first + entries.len(), n + 1))?;
|
||||
entries.push((Some(n + 1), v));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user