A lot of updates

This commit is contained in:
WolverinDEV
2020-05-07 21:28:15 +02:00
parent fd256411d1
commit 48326bd102
31 changed files with 3011 additions and 763 deletions
+4 -4
View File
@@ -605,7 +605,7 @@ bool ConnectedClient::notifyError(const command_result& result, const std::strin
auto bulks = result.bulks();
command.reserve_bulks(bulks->size());
for(size_t index{0}; index < bulks->size(); index++) {
auto entry = bulks->at(index);
auto& entry = bulks->at(index);
switch (entry.type()) {
case command_result_type::error:
write_command_result_error(command.bulk(index), entry);
@@ -828,14 +828,14 @@ bool ConnectedClient::handleCommandFull(Command& cmd, bool disconnectOnFail) {
command_result result;
try {
result = this->handleCommand(cmd);
result.reset(this->handleCommand(cmd));
} catch(invalid_argument& ex){
logWarning(this->getServerId(), "{}[Command] Failed to handle command. Received invalid argument exception: {}", CLIENT_STR_LOG_PREFIX, ex.what());
if(disconnectOnFail) {
this->disconnect("Invalid argument (" + string(ex.what()) + ")");
return false;
} else {
result = command_result{error::parameter_convert, ex.what()};
result.reset(command_result{error::parameter_convert, ex.what()});
}
} catch (exception& ex) {
logWarning(this->getServerId(), "{}[Command] Failed to handle command. Received exception with message: {}", CLIENT_STR_LOG_PREFIX, ex.what());
@@ -843,7 +843,7 @@ bool ConnectedClient::handleCommandFull(Command& cmd, bool disconnectOnFail) {
this->disconnect("Error while command handling (" + string(ex.what()) + ")!");
return false;
} else {
result = command_result{error::vs_critical};
result.reset(command_result{error::vs_critical});
}
} catch (...) {
this->disconnect("Error while command handling! (unknown)");