Commit e8333316 authored by Max Kellermann's avatar Max Kellermann

Permission: throw exception instead of raising fatal error

parent 85edcb85
...@@ -22,7 +22,7 @@ ...@@ -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) ...@@ -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,11 +102,11 @@ void initPermissions(void) ...@@ -102,11 +102,11 @@ 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(),
param->line); param->line);
std::string password(param->value.c_str(), separator); std::string password(param->value.c_str(), separator);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment