diff --git a/emitters/yaml_base_emitter.cpp b/emitters/yaml_base_emitter.cpp index 9f33cd0..cf2d7e2 100644 --- a/emitters/yaml_base_emitter.cpp +++ b/emitters/yaml_base_emitter.cpp @@ -339,14 +339,20 @@ bool yaml_base_emitter::check_object_array(const std::string& filepath, check_notify(filepath, nodepath, key, validate_message, update_message); }; + const auto notify_fail = [&](const std::string& message) { + check_notify(filepath, nodepath, key, message, message); + }; + if (!expected_node.count(key)) { - throw std::runtime_error("missing expected array?"); + notify_fail("missing expected array"); + throw std::runtime_error("Merge object array failure"); } const json& expected = expected_node[key]; if (!expected.is_array()) { - throw std::runtime_error("expected type mismatch?"); + notify_fail("expected type mismatch"); + throw std::runtime_error("Merge object array failure"); } json& result = merged_node[key]; diff --git a/emitters/yaml_enum_emitter.cpp b/emitters/yaml_enum_emitter.cpp index 93c2d34..10e6b23 100644 --- a/emitters/yaml_enum_emitter.cpp +++ b/emitters/yaml_enum_emitter.cpp @@ -45,6 +45,9 @@ bool yaml_enum_emitter::do_merge(const std::string& filepath, bool yaml_enum_emitter::emit(const json& j) { const std::string& name = j["name"]; + // Most likely an enum forward declaration. Nothing to document here. + if (j["values"].empty()) return true; + std::string filename; for (const auto& ns : j["namespaces"]) { filename += static_cast(ns) + "::";