mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 04:41:16 +00:00
Include name of anchor in invalid anchor error (#1015)
This commit is contained in:
@@ -424,8 +424,11 @@ anchor_t SingleDocParser::RegisterAnchor(const std::string& name) {
|
||||
anchor_t SingleDocParser::LookupAnchor(const Mark& mark,
|
||||
const std::string& name) const {
|
||||
auto it = m_anchors.find(name);
|
||||
if (it == m_anchors.end())
|
||||
throw ParserException(mark, ErrorMsg::UNKNOWN_ANCHOR);
|
||||
if (it == m_anchors.end()) {
|
||||
std::stringstream ss;
|
||||
ss << ErrorMsg::UNKNOWN_ANCHOR << name;
|
||||
throw ParserException(mark, ss.str());
|
||||
}
|
||||
|
||||
return it->second;
|
||||
}
|
||||
|
Reference in New Issue
Block a user