1
0
Fork 0

remove enterprise-gotos (#7375) (#7414)

This commit is contained in:
Wilfried Goesgens 2018-11-23 11:14:21 +01:00 committed by Jan
parent ebad3c3c83
commit d4af8fe287
2 changed files with 6 additions and 10 deletions

View File

@ -82,7 +82,7 @@ std::shared_ptr<AgencyCallback> AgencyCallbackRegistry::getCallback(uint32_t id)
auto it = _endpoints.find(id);
if (it == _endpoints.end()) {
THROW_ARANGO_EXCEPTION(TRI_ERROR_CLUSTER_UNKNOWN_CALLBACK_ENDPOINT);
return nullptr;
}
return (*it).second;
}

View File

@ -64,16 +64,12 @@ RestStatus RestAgencyCallbacksHandler::execute() {
return RestStatus::DONE;
}
std::shared_ptr<AgencyCallback> cb;
try {
uint32_t index = basics::StringUtils::uint32(suffixes.at(0));
cb = _agencyCallbackRegistry->getCallback(index);
} catch (arangodb::basics::Exception const&) {
// mop: not found...expected
uint32_t index = basics::StringUtils::uint32(suffixes.at(0));
auto cb = _agencyCallbackRegistry->getCallback(index);
if (cb.get() == nullptr) {
// no entry by this id!
resetResponse(arangodb::rest::ResponseCode::NOT_FOUND);
}
if (cb) {
} else {
LOG_TOPIC(DEBUG, Logger::CLUSTER)
<< "Agency callback has been triggered. refetching!";