Skip to content

Commit

Permalink
Merge pull request #18840 from rpastrana/HPCC-32052-WsStoreFetchMissM…
Browse files Browse the repository at this point in the history
…essage

HPCC-32052 Improve WsStore fetch miss message

Reviewed-by: Gavin Halliday <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Jul 17, 2024
2 parents 2b70219 + 8d2b067 commit c3c5e24
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 23 deletions.
8 changes: 2 additions & 6 deletions esp/services/ws_store/espstorelib/daliKVStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,15 +473,11 @@ bool CDALIKVStore::fetch(const char * storename, const char * ns, const char * k
encodePTreeName(encodedKey, key);
xpath.appendf("/%s", encodedKey.str());
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!");
Expand Down
20 changes: 3 additions & 17 deletions esp/services/ws_store/ws_storeService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,25 +313,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)
Expand Down

0 comments on commit c3c5e24

Please sign in to comment.