mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Return generic result for get operations that includes error messages
This commit is contained in:
parent
4695060d75
commit
f1a7376e0a
27 changed files with 83 additions and 53 deletions
|
@ -37,13 +37,16 @@ event zeek_init() {
|
|||
get_res = Storage::get(b, key, F);
|
||||
Storage::close_backend(b);
|
||||
|
||||
if ( get_res?$error )
|
||||
Reporter::error(get_res$error);
|
||||
|
||||
# Test attempting to use the closed handle.
|
||||
put_res = Storage::put(b, [$key="a", $value="b", $overwrite=F]);
|
||||
get_res = Storage::get(b, "a");
|
||||
erase_res = Storage::erase(b, "a");
|
||||
|
||||
print(fmt("results of trying to use closed handle: get: %d, put: %d, erase: %d",
|
||||
get_res, put_res, erase_res));
|
||||
get_res?$val, put_res, erase_res));
|
||||
|
||||
# Test failing to open the handle and test closing an invalid handle.
|
||||
opts$open_fail = T;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue