From 541a0dae24c342c49218a97186572db90a0d7500 Mon Sep 17 00:00:00 2001 From: Matej Ferencevic Date: Fri, 8 Sep 2017 10:15:13 +0200 Subject: [PATCH] Addded query error message to harness client. Reviewers: florijan Reviewed By: florijan Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D766 --- tests/macro_benchmark/harness/clients/common.hpp | 4 +++- tests/macro_benchmark/harness/clients/harness_client.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/macro_benchmark/harness/clients/common.hpp b/tests/macro_benchmark/harness/clients/common.hpp index 5f0a2afce..3b9e7dcda 100644 --- a/tests/macro_benchmark/harness/clients/common.hpp +++ b/tests/macro_benchmark/harness/clients/common.hpp @@ -50,13 +50,15 @@ void PrintJsonDecodedValue(std::ostream &os, template 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; } } diff --git a/tests/macro_benchmark/harness/clients/harness_client.cpp b/tests/macro_benchmark/harness/clients/harness_client.cpp index c510728bf..910111dfe 100644 --- a/tests/macro_benchmark/harness/clients/harness_client.cpp +++ b/tests/macro_benchmark/harness/clients/harness_client.cpp @@ -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();