Addded query error message to harness client.

Reviewers: florijan

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D766
This commit is contained in:
Matej Ferencevic 2017-09-08 10:15:13 +02:00
parent 2c4966edfe
commit 541a0dae24
2 changed files with 4 additions and 2 deletions

View File

@ -50,13 +50,15 @@ void PrintJsonDecodedValue(std::ostream &os,
template <typename ClientT, typename ExceptionT>
communication::bolt::QueryData ExecuteNTimesTillSuccess(
ClientT &client, const std::string &query, int times) {
ExceptionT last_exception;
for (int i = 0; i < times; ++i) {
try {
auto ret = client.Execute(query, {});
return ret;
} catch (const ExceptionT &e) {
last_exception = e;
}
}
throw ExceptionT();
throw last_exception;
}
}

View File

@ -88,7 +88,7 @@ void ExecuteQueries(std::istream &istream, int num_workers,
.metadata;
} catch (const ExceptionT &e) {
LOG(FATAL) << "Could not execute query '" << str << "' "
<< MAX_RETRIES << "times";
<< MAX_RETRIES << " times! Error message: " << e.what();
}
}
client.Close();