1
0
Fork 0

Improve syncer error message (#10404)

(cherry picked from commit 0a04067153356e035be35f42e890c7a02592985c)
This commit is contained in:
Simon 2019-11-12 20:32:46 +01:00 committed by KVS85
parent 413a81fba9
commit 4ddc94fac9
2 changed files with 5 additions and 3 deletions

View File

@ -640,6 +640,8 @@ Result parseResponse(velocypack::Builder& builder,
velocypack::Parser parser(builder);
parser.parse(response->getBody().begin(), response->getBody().length());
return Result();
} catch (VPackException const& e) {
return Result(TRI_ERROR_REPLICATION_INVALID_RESPONSE, e.what());
} catch (...) {
return Result(TRI_ERROR_REPLICATION_INVALID_RESPONSE);
}

View File

@ -228,7 +228,7 @@ Result syncChunkRocksDB(DatabaseInitialSyncer& syncer, SingleCollectionTransacti
if (r.fail()) {
return Result(TRI_ERROR_REPLICATION_INVALID_RESPONSE,
std::string("got invalid response from master at ") +
syncer._state.master.endpoint + ": response is no array");
syncer._state.master.endpoint + ": " + r.errorMessage());
}
VPackSlice const responseBody = builder.slice();
@ -425,7 +425,7 @@ Result syncChunkRocksDB(DatabaseInitialSyncer& syncer, SingleCollectionTransacti
return Result(TRI_ERROR_REPLICATION_INVALID_RESPONSE,
std::string("got invalid response from master at ") +
syncer._state.master.endpoint +
": response is no array");
": " + r.errorMessage());
}
VPackSlice const slice = docsBuilder->slice();
@ -613,7 +613,7 @@ Result handleSyncKeysRocksDB(DatabaseInitialSyncer& syncer,
if (r.fail()) {
return Result(TRI_ERROR_REPLICATION_INVALID_RESPONSE,
std::string("got invalid response from master at ") +
syncer._state.master.endpoint + ": response is no array");
syncer._state.master.endpoint + ": " + r.errorMessage());
}
VPackSlice const chunkSlice = builder.slice();