mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 07:04:37 +02:00
parent
dd77863910
commit
1ec20a1e8d
@ -564,7 +564,7 @@ lterm: T_LIBRARY rterm
|
|||||||
}
|
}
|
||||||
| T_THROW rterm
|
| T_THROW rterm
|
||||||
{
|
{
|
||||||
$$ = new ThrowExpression($2, @$);
|
$$ = new ThrowExpression($2, false, @$);
|
||||||
}
|
}
|
||||||
| rterm_side_effect
|
| rterm_side_effect
|
||||||
;
|
;
|
||||||
|
@ -242,9 +242,9 @@ Expression *ConfigCompiler::CompileStream(const String& path,
|
|||||||
try {
|
try {
|
||||||
return ctx.Compile();
|
return ctx.Compile();
|
||||||
} catch (const ScriptError& ex) {
|
} 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) {
|
} 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);
|
ExpressionResult messageres = m_Message->Evaluate(frame);
|
||||||
CHECK_RESULT(messageres);
|
CHECK_RESULT(messageres);
|
||||||
Value message = messageres.GetValue();
|
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
|
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
|
class I2_CONFIG_API ThrowExpression : public DebuggableExpression
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ThrowExpression(Expression *message, const DebugInfo& debugInfo = DebugInfo())
|
ThrowExpression(Expression *message, bool incompleteExpr, const DebugInfo& debugInfo = DebugInfo())
|
||||||
: DebuggableExpression(debugInfo), m_Message(message)
|
: DebuggableExpression(debugInfo), m_Message(message), m_IncompleteExpr(incompleteExpr)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
~ThrowExpression(void)
|
~ThrowExpression(void)
|
||||||
@ -761,6 +761,7 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
Expression *m_Message;
|
Expression *m_Message;
|
||||||
|
bool m_IncompleteExpr;
|
||||||
};
|
};
|
||||||
|
|
||||||
class I2_CONFIG_API ImportExpression : public DebuggableExpression
|
class I2_CONFIG_API ImportExpression : public DebuggableExpression
|
||||||
|
Loading…
x
Reference in New Issue
Block a user