zeek/testing/btest/core/expr-exception.bro
Jon Siwek c5d3ea009d Fix exceptions thrown in event handlers preventing others from running.
If some expression in an event handler body causes an
InterpreterException internally, then the rest of that body doesn't
get executed, but also the bodies of any other handlers were not
executed.
2012-06-11 15:35:09 -05:00

25 lines
589 B
Text

# Expressions in an event handler that raise interpreter exceptions
# shouldn't abort Bro entirely, but just return from the function body.
#
# @TEST-EXEC: bro -r $TRACES/wikipedia.trace %INPUT >output
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff reporter.log
# @TEST-EXEC: btest-diff output
event connection_established(c: connection)
{
print c$ftp;
print "not reached";
}
event connection_established(c: connection)
{
if ( c?$ftp )
print c$ftp;
else
print "ftp field missing";
}
event connection_established(c: connection)
{
print c$id;
}