mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 07:38:19 +00:00
Experimental code to better handle interpreter errors.
Currently, a lot of interpreter runtime errors, such as an access to an unset optional record field, cause Bro to abort with an internal error. This is an experimental branch that turns such errors into non-fatal runtime errors by internally raising exceptions. These are caught upstream and processing continues afterwards. For now, not many errors actually raise exceptions (the example above does though). We'll need to go through them eventually and adapt the current Internal() calls (and potentially others). More generally, at some point we should cleanup the interpreter error handling (unifying errors reported at parse- and runtime; and switching to exceptions for all Expr/Stmt/Vals). But that's a larger change and left for later. The main question for now is if this code is already helpful enough to go into 2.0. It will quite likely prevent a number of crashes due to script errors.
This commit is contained in:
parent
0ec1fa6a53
commit
15ab287436
12 changed files with 213 additions and 38 deletions
|
@ -200,7 +200,13 @@ void PersistenceSerializer::GotEvent(const char* name, double time,
|
|||
void PersistenceSerializer::GotFunctionCall(const char* name, double time,
|
||||
Func* func, val_list* args)
|
||||
{
|
||||
func->Call(args);
|
||||
try
|
||||
{
|
||||
func->Call(args);
|
||||
}
|
||||
|
||||
catch ( InterpreterException& e )
|
||||
{ /* Already reported. */ }
|
||||
}
|
||||
|
||||
void PersistenceSerializer::GotStateAccess(StateAccess* s)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue