diff options
Diffstat (limited to 'src/zenserver/config.cpp')
| -rw-r--r-- | src/zenserver/config.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/zenserver/config.cpp b/src/zenserver/config.cpp index d28262607..08ef17c12 100644 --- a/src/zenserver/config.cpp +++ b/src/zenserver/config.cpp @@ -5,6 +5,7 @@ #include "diag/logging.h" #include <zencore/crypto.h> +#include <zencore/except.h> #include <zencore/fmtutils.h> #include <zencore/iobuffer.h> #include <zencore/string.h> @@ -69,7 +70,7 @@ ValidateOptions(ZenServerOptions& ServerOptions) if (Key.IsValid() == false) { - throw cxxopts::OptionParseException("Invalid AES encryption key"); + throw zen::OptionParseException("Invalid AES encryption key"); } } @@ -79,7 +80,7 @@ ValidateOptions(ZenServerOptions& ServerOptions) if (IV.IsValid() == false) { - throw cxxopts::OptionParseException("Invalid AES initialization vector"); + throw zen::OptionParseException("Invalid AES initialization vector"); } } } @@ -581,7 +582,7 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions) { if (OpenIdClientId.empty()) { - throw cxxopts::OptionParseException("Invalid OpenID client ID"); + throw zen::OptionParseException("Invalid OpenID client ID"); } ServerOptions.AuthConfig.OpenIdProviders.push_back( @@ -607,6 +608,12 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions) throw; } + catch (zen::OptionParseException& e) + { + zen::logging::ConsoleLog().error("Error parsing zenserver arguments: {}\n\n{}", e.what(), options.help()); + + throw; + } if (ServerOptions.DataDir.empty()) { |