commands: return runtime errors on invalid property names

This commit is contained in:
2025-11-21 15:07:50 +09:00
parent ebfe1311b9
commit 95604aa20d
9 changed files with 43 additions and 24 deletions

View File

@@ -44,7 +44,9 @@ impl Command for AddId {
let parts: Vec<_> = parts.into();
let mut iter = parts.into_iter();
let (key, id) = get_next_and_parse_property!(iter, Text);
debug_assert!(key == "Id");
if key != "Id" {
return Err(ResponseParserError::UnexpectedProperty(key));
}
Ok(AddIdResponse { id })
}
}