mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 18:48:20 +00:00
Add a Reporter::fatal BIF.
This can be used from a Bro script to cause Bro to exit with non-zero status and a message to stderr. Uses of the exit() BIF in scripts for terminating Bro because of an error were replaced with this one, which addresses #564.
This commit is contained in:
parent
562abfb0d1
commit
31e70e447d
4 changed files with 12 additions and 5 deletions
|
@ -28,3 +28,11 @@ function Reporter::error%(msg: string%): bool
|
|||
reporter->PopLocation();
|
||||
return new Val(1, TYPE_BOOL);
|
||||
%}
|
||||
|
||||
function Reporter::fatal%(msg: string%): bool
|
||||
%{
|
||||
reporter->PushLocation(frame->GetCall()->GetLocationInfo());
|
||||
reporter->FatalError("%s", msg->CheckString());
|
||||
reporter->PopLocation();
|
||||
return new Val(1, TYPE_BOOL);
|
||||
%}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue