config/Data: add WithEach(ConfigBlockOption)

To improve error messages without making callers more complex.
This commit is contained in:
Max Kellermann
2022-07-12 21:02:49 +02:00
parent 89a18b49a7
commit ae4f4d3533
5 changed files with 46 additions and 20 deletions
+7
View File
@@ -143,3 +143,10 @@ ConfigBlock::GetBlockValue(const char *name, bool default_value) const
return bp->GetBoolValue();
}
void
ConfigBlock::ThrowWithNested() const
{
std::throw_with_nested(FormatRuntimeError("Error in block on line %i",
line));
}