8000 Feature/minor cleanup (#14661) · arangodb/arangodb@f31afe1 · GitHub
[go: up one dir, main page]

Skip to content

Commit f31afe1

Browse files
authored
Feature/minor cleanup (#14661)
1 parent dfbe4b9 commit f31afe1

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

arangod/RestHandler/RestShutdownHandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ RestStatus RestShutdownHandler::execute() {
9898
builder.add(VPackValue(true));
9999
AgencyCommResult result = agency.setValue("Shutdown", builder.slice(), 0.0);
100100
if (!result.successful()) {
101-
generateError(rest::ResponseCode::SERVER_ERROR, TRI_ERROR_HTTP_SERVER_ERROR);
101+
generateError(result.asResult());
102102
return RestStatus::DONE;
103103
}
104104
removeFromCluster = true;

arangosh/Utils/ClientManager.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "ClientManager.h"
2626

2727
#include "ApplicationFeatures/ApplicationServer.h"
28+
#include "Basics/StaticStrings.h"
2829
#include "Basics/VelocyPackHelper.h"
2930
#include "Basics/application-exit.h"
3031
#include "Logger/Logger.h"
@@ -56,9 +57,11 @@ arangodb::Result getHttpErrorMessage(arangodb::httpclient::SimpleHttpResult* res
5657
std::shared_ptr<VPackBuilder> parsedBody = result->getBodyVelocyPack();
5758
VPackSlice const body = parsedBody->slice();
5859

59-
auto serverCode = VelocyPackHelper::getNumericValue<int>(body, "errorNum", 0);
60-
std::string const& serverMessage =
61-
VelocyPackHelper::getStringValue(body, "errorMessage", "");
60+
auto serverCode =
61+
VelocyPackHelper::getNumericValue<int>(body, arangodb::StaticStrings::ErrorNum, 0);
62+
auto serverMessage =
63+
VelocyPackHelper::getStringValue(body, arangodb::StaticStrings::ErrorMessage,
64+
"");
6265

6366
if (serverCode > 0) {
6467
code = ErrorCode{serverCode};

0 commit comments

Comments
 (0)
0