From 36a9ac86b813fbbcd977ef43420471d413e0735f Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenkov Date: Tue, 5 Nov 2019 16:05:48 +0300 Subject: [PATCH] More verbose error message in macros. --- dbms/src/Common/Macros.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dbms/src/Common/Macros.cpp b/dbms/src/Common/Macros.cpp index ac64cc4ca46..a234bdd8be6 100644 --- a/dbms/src/Common/Macros.cpp +++ b/dbms/src/Common/Macros.cpp @@ -1,6 +1,7 @@ #include #include #include +#include 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; }