Improve error reporting for the import keyword

fixes #8061
This commit is contained in:
Gunnar Beutner 2014-12-20 11:09:21 +01:00
parent e03e143177
commit ee5f4fb7e3
1 changed files with 3 additions and 0 deletions

View File

@ -482,6 +482,9 @@ Value ImportExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
String type = VMOps::GetField(frame.Self, "type", m_DebugInfo);
Value name = m_Name->Evaluate(frame);
if (!name.IsString())
BOOST_THROW_EXCEPTION(ScriptError("Template/object name must be a string", m_DebugInfo));
ConfigItem::Ptr item = ConfigItem::GetObject(type, name);
if (!item)