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:
parent
2c4966edfe
commit
541a0dae24
@ -50,13 +50,15 @@ void PrintJsonDecodedValue(std::ostream &os,
|
|||||||
template <typename ClientT, typename ExceptionT>
|
template <typename ClientT, typename ExceptionT>
|
||||||
communication::bolt::QueryData ExecuteNTimesTillSuccess(
|
communication::bolt::QueryData ExecuteNTimesTillSuccess(
|
||||||
ClientT &client, const std::string &query, int times) {
|
ClientT &client, const std::string &query, int times) {
|
||||||
|
ExceptionT last_exception;
|
||||||
for (int i = 0; i < times; ++i) {
|
for (int i = 0; i < times; ++i) {
|
||||||
try {
|
try {
|
||||||
auto ret = client.Execute(query, {});
|
auto ret = client.Execute(query, {});
|
||||||
return ret;
|
return ret;
|
||||||
} catch (const ExceptionT &e) {
|
} catch (const ExceptionT &e) {
|
||||||
|
last_exception = e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw ExceptionT();
|
throw last_exception;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ void ExecuteQueries(std::istream &istream, int num_workers,
|
|||||||
.metadata;
|
.metadata;
|
||||||
} catch (const ExceptionT &e) {
|
} catch (const ExceptionT &e) {
|
||||||
LOG(FATAL) << "Could not execute query '" << str << "' "
|
LOG(FATAL) << "Could not execute query '" << str << "' "
|
||||||
<< MAX_RETRIES << "times";
|
<< MAX_RETRIES << " times! Error message: " << e.what();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
client.Close();
|
client.Close();
|
||||||
|
Loading…
Reference in New Issue
Block a user