Permission: throw exception instead of raising fatal error
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
#include "config/Param.hxx"
|
#include "config/Param.hxx"
|
||||||
#include "config/ConfigGlobal.hxx"
|
#include "config/ConfigGlobal.hxx"
|
||||||
#include "config/ConfigOption.hxx"
|
#include "config/ConfigOption.hxx"
|
||||||
#include "system/FatalError.hxx"
|
#include "util/RuntimeError.hxx"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <map>
|
#include <map>
|
||||||
@@ -56,7 +56,7 @@ ParsePermission(const char *p)
|
|||||||
if (strcmp(p, i->name) == 0)
|
if (strcmp(p, i->name) == 0)
|
||||||
return i->value;
|
return i->value;
|
||||||
|
|
||||||
FormatFatalError("unknown permission \"%s\"", p);
|
throw FormatRuntimeError("unknown permission \"%s\"", p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned parsePermissions(const char *string)
|
static unsigned parsePermissions(const char *string)
|
||||||
@@ -102,7 +102,7 @@ void initPermissions(void)
|
|||||||
PERMISSION_PASSWORD_CHAR);
|
PERMISSION_PASSWORD_CHAR);
|
||||||
|
|
||||||
if (separator == NULL)
|
if (separator == NULL)
|
||||||
FormatFatalError("\"%c\" not found in password string "
|
throw FormatRuntimeError("\"%c\" not found in password string "
|
||||||
"\"%s\", line %i",
|
"\"%s\", line %i",
|
||||||
PERMISSION_PASSWORD_CHAR,
|
PERMISSION_PASSWORD_CHAR,
|
||||||
param->value.c_str(),
|
param->value.c_str(),
|
||||||
|
Reference in New Issue
Block a user