Skip to content

Commit

Permalink
Fail KeyValueTreeLoader loading if a line is not parsed correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsht committed May 5, 2024
1 parent d623512 commit 3e4db62
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/io/keyValueTreeLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ KeyValueTreeLoader::KeyValueTreeLoader(const string& resource_name)
}
result = std::make_shared<KeyValueTree>();

LOG(Info, "Loading tree", resource_name);
LOG(Info, "Loading tree ", resource_name);

while(stream->tell() < stream->getSize())
{
Expand All @@ -44,7 +44,7 @@ KeyValueTreeLoader::KeyValueTreeLoader(const string& resource_name)
}
else if (line == "}")
{
LOG(Error, "Failed to parse key value tree: Node close while no node open.", resource_name);
LOG(Error, "Failed to parse key value tree: Node close while no node open. ", resource_name);
result = nullptr;
return;
}
Expand All @@ -54,8 +54,8 @@ KeyValueTreeLoader::KeyValueTreeLoader(const string& resource_name)
}
else if (line.length() > 0)
{
LOG(Error, "Failed to parse line:", line);
result->root_nodes.clear();
LOG(Error, "Failed to parse line: ", line);
result = nullptr;
return;
}
}
Expand Down

0 comments on commit 3e4db62

Please sign in to comment.