From: Gunnar Beutner Date: Mon, 29 Jan 2018 09:04:58 +0000 (+0100) Subject: Improve location info for some error messages X-Git-Tag: v2.9.0~186^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1047e5ff3d50b08294eca163ee6992f61fc72545;p=icinga2 Improve location info for some error messages --- diff --git a/lib/config/config_parser.yy b/lib/config/config_parser.yy index 6e41b2864..70f309bd3 100644 --- a/lib/config/config_parser.yy +++ b/lib/config/config_parser.yy @@ -388,7 +388,7 @@ object: bool defaultTmpl = $6; if (!abstract && defaultTmpl) - BOOST_THROW_EXCEPTION(ScriptError("'default' keyword is invalid for object definitions", DebugInfoRange(@2, @4))); + BOOST_THROW_EXCEPTION(ScriptError("'default' keyword is invalid for object definitions", @6)); bool seen_assign = context->m_SeenAssign.top(); context->m_SeenAssign.pop(); @@ -1158,7 +1158,7 @@ apply: delete $6; if (!ApplyRule::IsValidSourceType(type)) - BOOST_THROW_EXCEPTION(ScriptError("'apply' cannot be used with type '" + type + "'", DebugInfoRange(@2, @3))); + BOOST_THROW_EXCEPTION(ScriptError("'apply' cannot be used with type '" + type + "'", @3)); if (!ApplyRule::IsValidTargetType(type, target)) { if (target == "") { @@ -1178,7 +1178,7 @@ apply: BOOST_THROW_EXCEPTION(ScriptError("'apply' target type is ambiguous (can be one of " + typeNames + "): use 'to' to specify a type", DebugInfoRange(@2, @3))); } else - BOOST_THROW_EXCEPTION(ScriptError("'apply' target type '" + target + "' is invalid", DebugInfoRange(@2, @5))); + BOOST_THROW_EXCEPTION(ScriptError("'apply' target type '" + target + "' is invalid", @6)); } bool seen_assign = context->m_SeenAssign.top();