Skip to content

Commit

Permalink
Clean up typos in yaml error messages (RobotLocomotion#17773)
Browse files Browse the repository at this point in the history
 - s/usign/using
 - Typically the formatting is ...key 'key_name'...,
   - one error message was missing the ticks.
  • Loading branch information
SeanCurtis-TRI authored Aug 24, 2022
1 parent a0ea0a3 commit 665f178
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions common/yaml/test/yaml_read_archive_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -756,8 +756,8 @@ TEST_P(YamlReadArchiveTest, VisitScalarFoundNothing) {
AcceptIntoDummy<OuterStruct>(node),
"YAML node of type Mapping"
" \\(with size 1 and keys \\{inner_value_TYPO\\}\\)"
" key inner_value_TYPO did not match any visited value entry for <root>"
" while accepting YAML node of type Mapping"
" key 'inner_value_TYPO' did not match any visited value entry for"
" <root> while accepting YAML node of type Mapping"
" \\(with size 2 and keys \\{inner_struct, outer_value\\}\\)"
" while visiting [^ ]*InnerStruct inner_struct\\.");
} else {
Expand Down
2 changes: 1 addition & 1 deletion common/yaml/yaml_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ void Node::Add(std::string key, Node value) {
// for the error message we need to dig the existing key out of the map.
const std::string& old_key = result.first->first;
throw std::logic_error(fmt::format(
"Cannot Node::Add(key, value) usign duplicate key '{}'", old_key));
"Cannot Node::Add(key, value) using duplicate key '{}'", old_key));
}
},
[](auto&& data) -> void {
Expand Down
2 changes: 1 addition & 1 deletion common/yaml/yaml_read_archive.cc
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ void YamlReadArchive::CheckAllAccepted() const {
unused(value);
if (visited_names_.count(key) == 0) {
ReportError(fmt::format(
"key {} did not match any visited value", key));
"key '{}' did not match any visited value", key));
}
}
}
Expand Down

0 comments on commit 665f178

Please sign in to comment.