From a08f4588ebb44783f0bf6dbf6042d540ae40b399 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 1 Oct 2014 15:13:11 +0100 Subject: [PATCH] Add error message for missing imports (and possibly other errors) fixes #7331 --- lib/config/configitem.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/config/configitem.cpp b/lib/config/configitem.cpp index 6de092d48..ad5ae174c 100644 --- a/lib/config/configitem.cpp +++ b/lib/config/configitem.cpp @@ -268,7 +268,14 @@ void ConfigItem::ValidateItem(void) return; } - ctype->ValidateItem(GetSelf()); + try { + ctype->ValidateItem(GetSelf()); + } catch (const ConfigError& ex) { + const DebugInfo *di = boost::get_error_info(ex); + ConfigCompilerContext::GetInstance()->AddMessage(true, ex.what(), di ? *di : DebugInfo()); + } catch (const std::exception& ex) { + ConfigCompilerContext::GetInstance()->AddMessage(true, DiagnosticInformation(ex)); + } m_Validated = true; } -- 2.40.0