config/Block: add ThrowWithNested()
This commit is contained in:
parent
7d599c1afc
commit
ece35552fe
@ -26,6 +26,13 @@
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
void
|
||||
BlockParam::ThrowWithNested() const
|
||||
{
|
||||
std::throw_with_nested(FormatRuntimeError("Error in setting \"%s\" on line %i",
|
||||
name.c_str(), line));
|
||||
}
|
||||
|
||||
int
|
||||
BlockParam::GetIntValue() const
|
||||
{
|
||||
|
@ -51,6 +51,14 @@ struct BlockParam {
|
||||
unsigned GetPositiveValue() const;
|
||||
|
||||
bool GetBoolValue() const;
|
||||
|
||||
/**
|
||||
* Call this method in a "catch" block to throw a nested
|
||||
* exception showing the location of this setting in the
|
||||
* configuration file.
|
||||
*/
|
||||
[[noreturn]]
|
||||
void ThrowWithNested() const;
|
||||
};
|
||||
|
||||
struct ConfigBlock {
|
||||
|
Loading…
Reference in New Issue
Block a user