commands: return runtime errors on invalid property names
This commit is contained in:
@@ -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 })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user