From bd05fae9aa301603ef850aed774209227a66e193 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 13 Aug 2017 00:49:39 +0200 Subject: [PATCH] Enhanced error handling for unit test runner. --- src/ut/utMain.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ut/utMain.cc b/src/ut/utMain.cc index 99abb31e5..e61ac531e 100644 --- a/src/ut/utMain.cc +++ b/src/ut/utMain.cc @@ -822,13 +822,15 @@ main_cont (int argc, char **argv) // there is no "dlopen" on mingw, so we need to emulate it. HINSTANCE handle = LoadLibraryW ((const wchar_t *) tl::to_qstring (pp).constData ()); if (! handle) { - throw tl::Exception (tl::to_string (QObject::tr ("Unable to load plugin tests: %s with error message: %s ")), pp, GetLastError ()); + std::cerr << tl::sprintf ("Unable to load plugin tests: %s with error message: %s", pp.c_str (), GetLastError ()) << std::endl; + exit (1); } #else void *handle; handle = dlopen (tl::string_to_system (pp).c_str (), RTLD_LAZY); if (! handle) { - throw tl::Exception (tl::to_string (QObject::tr ("Unable to load plugin tests: %s")), pp); + std::cerr << tl::sprintf ("Unable to load plugin tests: %s", pp.c_str ()) << std::endl; + exit (1); } #endif