Change assert to LOGICAL_ERROR

This commit is contained in:
Antonio Andelic 2022-09-07 09:24:50 +00:00
parent 4cdf18cc81
commit a377a5f1e9

View File

@ -830,7 +830,9 @@ bool KeeperStorage::checkACL(StringRef path, int32_t permission, int64_t session
void KeeperStorage::unregisterEphemeralPath(int64_t session_id, const std::string & path) void KeeperStorage::unregisterEphemeralPath(int64_t session_id, const std::string & path)
{ {
auto ephemerals_it = ephemerals.find(session_id); auto ephemerals_it = ephemerals.find(session_id);
assert(ephemerals_it != ephemerals.end()); if (ephemerals_it == ephemerals.end())
throw Exception(ErrorCodes::LOGICAL_ERROR, "Session {} is missing ephemeral path");
ephemerals_it->second.erase(path); ephemerals_it->second.erase(path);
if (ephemerals_it->second.empty()) if (ephemerals_it->second.empty())
ephemerals.erase(ephemerals_it); ephemerals.erase(ephemerals_it);