diff --git a/arangod/Agency/Agent.cpp b/arangod/Agency/Agent.cpp index b4caa78006..8f50496646 100644 --- a/arangod/Agency/Agent.cpp +++ b/arangod/Agency/Agent.cpp @@ -283,9 +283,9 @@ void Agent::run() { _cv.wait(250000); else _cv.wait(); - std::vector work(size()); + // Collect all unacknowledged - for (size_t i = 0; i < size(); ++i) { + for (id_t i = 0; i < size(); ++i) { if (i != id()) { sendAppendEntriesRPC(i); } diff --git a/arangod/RestHandler/RestAgencyHandler.cpp b/arangod/RestHandler/RestAgencyHandler.cpp index ddb1a9e637..a427781a68 100644 --- a/arangod/RestHandler/RestAgencyHandler.cpp +++ b/arangod/RestHandler/RestAgencyHandler.cpp @@ -89,7 +89,11 @@ inline HttpHandler::status_t RestAgencyHandler::handleWrite () { query = _request->toVelocyPack(&options); } catch (std::exception const& e) { LOG_TOPIC(ERR, Logger::AGENCY) << e.what(); - generateError(HttpResponse::UNPROCESSABLE_ENTITY,422); + Builder body; + body.openObject(); + body.add("message", VPackValue(e.what())); + body.close(); + generateResult(HttpResponse::BAD,body.slice()); return HttpHandler::status_t(HANDLER_DONE); } @@ -165,7 +169,7 @@ inline HttpHandler::status_t RestAgencyHandler::handleRead () { return HttpHandler::status_t(HANDLER_DONE); } -HttpHandler::status_t RestAgencyHandler::handleTest() { +HttpHandler::status_t RestAgencyHandler::handleConfig() { Builder body; body.add(VPackValue(VPackValueType::Object)); body.add("term", Value(_agent->term())); @@ -206,7 +210,7 @@ HttpHandler::status_t RestAgencyHandler::execute() { if (_request->requestType() != HttpRequest::HTTP_REQUEST_GET) { return reportMethodNotAllowed(); } - return handleTest(); + return handleConfig(); } else if (_request->suffix()[0] == "state") { if (_request->requestType() != HttpRequest::HTTP_REQUEST_GET) { return reportMethodNotAllowed(); diff --git a/arangod/RestHandler/RestAgencyHandler.h b/arangod/RestHandler/RestAgencyHandler.h index 0d6583ca41..189cb9e0e6 100644 --- a/arangod/RestHandler/RestAgencyHandler.h +++ b/arangod/RestHandler/RestAgencyHandler.h @@ -50,7 +50,7 @@ class RestAgencyHandler : public arangodb::RestBaseHandler { status_t reportUnknownMethod() ; status_t handleRead() ; status_t handleWrite() ; - status_t handleTest(); + status_t handleConfig(); status_t reportMethodNotAllowed(); status_t handleState();