1
0
Fork 0

added handleSimpleError for database not found

This commit is contained in:
a-brandt 2016-08-15 17:05:35 +02:00
parent e511cd4ab9
commit 758cc8c985
1 changed files with 10 additions and 3 deletions

View File

@ -360,12 +360,19 @@ bool VppCommTask::processRead() {
<< "got request:" << message._header.toJson(); << "got request:" << message._header.toJson();
_request = new VppRequest(_connectionInfo, std::move(message)); _request = new VppRequest(_connectionInfo, std::move(message));
GeneralServerFeature::HANDLER_FACTORY->setRequestContext(_request); GeneralServerFeature::HANDLER_FACTORY->setRequestContext(_request);
if (_request->requestContext() == nullptr) {
handleSimpleError(GeneralResponse::ResponseCode::NOT_FOUND, TRI_ERROR_ARANGO_DATABASE_NOT_FOUND,
TRI_errno_string(TRI_ERROR_ARANGO_DATABASE_NOT_FOUND));
}
else {
_request->setClientTaskId(_taskId); _request->setClientTaskId(_taskId);
_protocolVersion = _request->protocolVersion(); _protocolVersion = _request->protocolVersion();
executeRequest(_request, executeRequest(_request,
new VppResponse(GeneralResponse::ResponseCode::SERVER_ERROR, new VppResponse(GeneralResponse::ResponseCode::SERVER_ERROR,
chunkHeader._messageID)); chunkHeader._messageID));
} }
}
if (read_maybe_only_part_of_buffer) { if (read_maybe_only_part_of_buffer) {
if (prv._readBufferCursor == _readBuffer->end()) { if (prv._readBufferCursor == _readBuffer->end()) {