Merge pull request #7634 from ClickHouse/aku/macros-verbose-error

More verbose error message in macros.
This commit is contained in:
alexey-milovidov 2019-11-05 19:02:34 +03:00 committed by GitHub
commit a44d08bea9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
#include <Poco/Util/AbstractConfiguration.h>
#include <Common/Macros.h>
#include <Common/Exception.h>
#include <IO/WriteHelpers.h>
namespace DB
@ -66,7 +67,9 @@ String Macros::expand(const String & s, size_t level, const String & database_na
else if (macro_name == "table" && !table_name.empty())
res += table_name;
else
throw Exception("No macro " + macro_name + " in config", ErrorCodes::SYNTAX_ERROR);
throw Exception("No macro '" + macro_name +
"' in config while processing substitutions in '" + s + "' at "
+ toString(begin), ErrorCodes::SYNTAX_ERROR);
pos = end + 1;
}