From ca6b172b9176883171a0e4f70188150ac68bf48a Mon Sep 17 00:00:00 2001
From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz>
Date: Thu, 21 Mar 2019 16:32:49 +0100
Subject: [PATCH] fix reporting of exceptions in integration tests

---
 alib2integrationtest/test-src/testing/TimeoutAqlTest.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/alib2integrationtest/test-src/testing/TimeoutAqlTest.cpp b/alib2integrationtest/test-src/testing/TimeoutAqlTest.cpp
index cd47e92024..1c3877dd77 100644
--- a/alib2integrationtest/test-src/testing/TimeoutAqlTest.cpp
+++ b/alib2integrationtest/test-src/testing/TimeoutAqlTest.cpp
@@ -9,6 +9,7 @@
 #include <string.h>
 
 #include <global/GlobalData.h>
+#include <alib/exception>
 
 #define PIPE_RD 0
 #define PIPE_WR 1
@@ -56,10 +57,10 @@ int aqlTest ( int fd, const ext::vector < std::string > & queries ) {
 		}
 
 		return environment.getResult ( ); /* 0 = OK */
-	} catch ( const std::exception & e ) {
-		const char * what = e.what ( );
-		ssize_t what_len = ( ssize_t ) strlen ( what );
-		if ( write ( fd, what, what_len ) != what_len )
+	} catch ( const std::exception & ) {
+		std::ostringstream oss;
+		alib::ExceptionHandler::handle ( oss );
+		if ( write ( fd, oss.str ( ).c_str ( ), oss.str ( ).length ( ) ) != ( ssize_t ) oss.str ( ).length ( ) )
 			throw std::runtime_error ( "TimeoutAqlTest: write() failure (child to parent communication)" );
 		return -1;
 	}
-- 
GitLab