Merge remote-tracking branch 'origin/topic/jsiwek/gh-211'

* origin/topic/jsiwek/gh-211:
  GH-208: change invalid subnet expressions to a runtime error
  GH-211: improve consistency of how scripting errors are handled

Removed the 'allow_init_errors' option.
This commit is contained in:
Jon Siwek 2019-02-07 10:32:01 -06:00
commit 0790c1c559
53 changed files with 441 additions and 156 deletions

View file

@ -1161,7 +1161,16 @@ int main(int argc, char** argv)
stmt_flow_type flow;
Frame f(current_scope()->Length(), 0, 0);
g_frame_stack.push_back(&f);
stmts->Exec(&f, flow);
try
{
stmts->Exec(&f, flow);
}
catch ( InterpreterException& )
{
reporter->FatalError("failed to execute script statements at top-level scope");
}
g_frame_stack.pop_back();
}
@ -1185,6 +1194,9 @@ int main(int argc, char** argv)
// Drain the event queue here to support the protocols framework configuring DPM
mgr.Drain();
if ( reporter->Errors() > 0 && ! getenv("ZEEK_ALLOW_INIT_ERRORS") )
reporter->FatalError("errors occurred while initializing");
broker_mgr->BroInitDone();
analyzer_mgr->DumpDebug();