forked from 1b-agent/fieldcraft-upstream
Engine: a parameter error carries its key and problem (EngineError::Param)
A form can show the problem beside the field it is about. The message still names the key, as before, for agents. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo
This commit is contained in:
1 parent
8df4ea040c
commit
9dcbb9c9a6
14 files changed
+60
-49
No files matched your search
@@ -1046,7 +1046,11 @@ mod tests {
|
||||
fill_required(&s, form, &mut p);
|
||||
}
|
||||
let missing: Vec<String> = problems(form, &p).into_iter().filter(|p| p.message == "required").map(|p| p.path).collect();
|
||||
match s.execute(c.id, &p) {
|
||||
let r = s.execute(c.id, &p).map_err(|e| match e {
|
||||
EngineError::Param { .. } => EngineError::Params(e.to_string()),
|
||||
e => e,
|
||||
});
|
||||
match r {
|
||||
// State, not parameters: the meshers' default is the open design's bodies, the
|
||||
// bar has no explicit step; activation and probes need one of several fields.
|
||||
Err(EngineError::Params(e)) if STATE.iter().any(|m| e.contains(m)) => {}
|
||||
|
||||
Reference in new issue
Block a user