mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-05 06:26:49 +00:00
Patch manager: add node location to patch errors
This commit is contained in:
parent
855b23b3fe
commit
499fe3e218
5 changed files with 61 additions and 42 deletions
|
|
@ -59,6 +59,23 @@ T get_yaml_node_value(YAML::Node node, std::string& error_message)
|
|||
return {};
|
||||
}
|
||||
|
||||
std::string get_yaml_node_location(YAML::Node node)
|
||||
{
|
||||
try
|
||||
{
|
||||
const auto mark = node.Mark();
|
||||
|
||||
if (mark.is_null())
|
||||
return "unknown";
|
||||
|
||||
return fmt::format("line %d, column %d", mark.line, mark.column); // Don't need the pos. It's not really useful.
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
return e.what();
|
||||
}
|
||||
}
|
||||
|
||||
template u32 get_yaml_node_value<u32>(YAML::Node, std::string&);
|
||||
template u64 get_yaml_node_value<u64>(YAML::Node, std::string&);
|
||||
template f64 get_yaml_node_value<f64>(YAML::Node, std::string&);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue