Merge pull request #1253 from notlesh/better-config-error-messages-2020-05-04

Use more user-friendly error messages in config
pull/1255/head
Jason Rhinelander 4 years ago committed by GitHub
commit 4be7b2c8a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -62,7 +62,7 @@ namespace llarp
{
// fallback to undeclared handler if available
if (not haveUndeclaredHandler)
throw std::invalid_argument(stringify("no declared section [", section, "]"));
throw std::invalid_argument(stringify("unrecognized section [", section, "]"));
else
{
auto& handler = undItr->second;
@ -78,7 +78,7 @@ namespace llarp
if (defItr == sectionDefinitions.end())
{
if (not haveUndeclaredHandler)
throw std::invalid_argument(stringify("no declared option [", section, "]:", name));
throw std::invalid_argument(stringify("unrecognized option [", section, "]:", name));
else
{
auto& handler = undItr->second;

Loading…
Cancel
Save