mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 07:38:19 +00:00
Make ValFromJSON return zeek::expected instead of a variant
This commit is contained in:
parent
e545fe8256
commit
201d4508e6
6 changed files with 64 additions and 60 deletions
|
@ -440,10 +440,10 @@ void Redis::HandleGetResult(redisReply* reply, ResultCallback* callback) {
|
|||
res = ParseReplyError("get", reply->str);
|
||||
else {
|
||||
auto val = zeek::detail::ValFromJSON(reply->str, val_type, Func::nil);
|
||||
if ( std::holds_alternative<ValPtr>(val) )
|
||||
res = {ReturnCode::SUCCESS, "", std::get<ValPtr>(val)};
|
||||
if ( val )
|
||||
res = {ReturnCode::SUCCESS, "", val.value()};
|
||||
else
|
||||
res = {ReturnCode::OPERATION_FAILED, std::get<std::string>(val)};
|
||||
res = {ReturnCode::OPERATION_FAILED, val.error()};
|
||||
}
|
||||
|
||||
freeReplyObject(reply);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue