mirror of https://github.com/Icinga/icinga2.git
parent
dd77863910
commit
1ec20a1e8d
|
@ -564,7 +564,7 @@ lterm: T_LIBRARY rterm
|
|||
}
|
||||
| T_THROW rterm
|
||||
{
|
||||
$$ = new ThrowExpression($2, @$);
|
||||
$$ = new ThrowExpression($2, false, @$);
|
||||
}
|
||||
| rterm_side_effect
|
||||
;
|
||||
|
|
|
@ -242,9 +242,9 @@ Expression *ConfigCompiler::CompileStream(const String& path,
|
|||
try {
|
||||
return ctx.Compile();
|
||||
} catch (const ScriptError& ex) {
|
||||
return new ThrowExpression(MakeLiteral(ex.what()), ex.GetDebugInfo());
|
||||
return new ThrowExpression(MakeLiteral(ex.what()), ex.IsIncompleteExpression(), ex.GetDebugInfo());
|
||||
} catch (const std::exception& ex) {
|
||||
return new ThrowExpression(MakeLiteral(DiagnosticInformation(ex)));
|
||||
return new ThrowExpression(MakeLiteral(DiagnosticInformation(ex)), false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -698,7 +698,7 @@ ExpressionResult ThrowExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhin
|
|||
ExpressionResult messageres = m_Message->Evaluate(frame);
|
||||
CHECK_RESULT(messageres);
|
||||
Value message = messageres.GetValue();
|
||||
BOOST_THROW_EXCEPTION(ScriptError(message, m_DebugInfo));
|
||||
BOOST_THROW_EXCEPTION(ScriptError(message, m_DebugInfo, m_IncompleteExpr));
|
||||
}
|
||||
|
||||
ExpressionResult ImportExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhint) const
|
||||
|
|
|
@ -747,8 +747,8 @@ I2_CONFIG_API void BindToScope(Expression *& expr, ScopeSpecifier scopeSpec);
|
|||
class I2_CONFIG_API ThrowExpression : public DebuggableExpression
|
||||
{
|
||||
public:
|
||||
ThrowExpression(Expression *message, const DebugInfo& debugInfo = DebugInfo())
|
||||
: DebuggableExpression(debugInfo), m_Message(message)
|
||||
ThrowExpression(Expression *message, bool incompleteExpr, const DebugInfo& debugInfo = DebugInfo())
|
||||
: DebuggableExpression(debugInfo), m_Message(message), m_IncompleteExpr(incompleteExpr)
|
||||
{ }
|
||||
|
||||
~ThrowExpression(void)
|
||||
|
@ -761,6 +761,7 @@ protected:
|
|||
|
||||
private:
|
||||
Expression *m_Message;
|
||||
bool m_IncompleteExpr;
|
||||
};
|
||||
|
||||
class I2_CONFIG_API ImportExpression : public DebuggableExpression
|
||||
|
|
Loading…
Reference in New Issue