Return generic result for get operations that includes error messages

This commit is contained in:
Tim Wojtulewicz 2025-01-22 17:00:38 -07:00
parent 4695060d75
commit f1a7376e0a
27 changed files with 83 additions and 53 deletions

View file

@ -356,6 +356,14 @@ type ftp_port: record {
valid: bool; ##< True if format was right. Only then are *h* and *p* valid.
};
## A generic type for returning either a value or an error string from a
## function or a BIF method. This is sort of equivalent to std::expected
## in C++.
type val_result: record {
val: any &optional;
error: string &optional;
};
## Statistics about what a TCP endpoint sent.
##
## .. zeek:see:: conn_stats