From 8d2b0677d4c14694baa9253e249ecbbdfdda0fc4 Mon Sep 17 00:00:00 2001 From: Rodrigo Pastrana Date: Fri, 28 Jun 2024 17:59:51 -0400 Subject: [PATCH] HPCC-32052 Improve WsStore fetch miss message - Changes log message to clarify simple fetch miss - Removes dependancy on exception on misses - Removes dbg logging of misses - Fixes invalid response type in CDALIKVStore::fetch Signed-off-by: Rodrigo Pastrana --- .../ws_store/espstorelib/daliKVStore.cpp | 8 ++------ esp/services/ws_store/ws_storeService.cpp | 20 +++---------------- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/esp/services/ws_store/espstorelib/daliKVStore.cpp b/esp/services/ws_store/espstorelib/daliKVStore.cpp index b3f1a40419d..fbda761a692 100644 --- a/esp/services/ws_store/espstorelib/daliKVStore.cpp +++ b/esp/services/ws_store/espstorelib/daliKVStore.cpp @@ -401,15 +401,11 @@ bool CDALIKVStore::fetch(const char * storename, const char * ns, const char * k { xpath.appendf("/%s", key); if(!storetree->hasProp(xpath.str())) - { - throw makeStringExceptionV(ECLWATCH_INVALID_QUERY_KEY, "DALI Keystore fetch: invalid key '%s' detected!", key); - } + return false; else - { value.set(storetree->queryProp(xpath.str())); - } - return value.str(); + return true; } else throw makeStringException(-1, "DALI Keystore fetch: Key not provided!"); diff --git a/esp/services/ws_store/ws_storeService.cpp b/esp/services/ws_store/ws_storeService.cpp index 75ddde7d6e5..e63cb3db7b8 100644 --- a/esp/services/ws_store/ws_storeService.cpp +++ b/esp/services/ws_store/ws_storeService.cpp @@ -312,25 +312,11 @@ bool CwsstoreEx::onFetch(IEspContext &context, IEspFetchRequest &req, IEspFetchR storename = m_defaultStore.get(); } - try - { - m_storeProvider->fetch(storename, req.getNamespace(), req.getKey(), value, secuser.get(), !req.getUserSpecific()); + bool success = m_storeProvider->fetch(storename, req.getNamespace(), req.getKey(), value, secuser.get(), !req.getUserSpecific()); + if (success) resp.setValue(value.str()); - } - catch(IException * e) - { - if (e->errorCode() == ECLWATCH_INVALID_QUERY_KEY) - { - StringBuffer msg; - LOG(MCuserInfo, "WsStore: %s", e->errorMessage(msg).str()); - e->Release(); - return false; - } - else - throw e; - } - return true; + return success; } bool CwsstoreEx::onFetchKeyMetadata(IEspContext &context, IEspFetchKeyMDRequest &req, IEspFetchKeyMDResponse &resp)