Commit b013f9f2 authored by Steven Murray's avatar Steven Murray
Browse files

Improved the exception handling within the main() function of cta-rdbmsUnitTests

parent 383fed11
......@@ -54,6 +54,7 @@ static RdbmsUnitTestsCmdLineArgs parseCmdLine(const int argc, char ** argv) {
}
int main(int argc, char** argv) {
try {
// The following line must be executed to initialize Google Mock
// (and Google Test) before running the tests.
::testing::InitGoogleMock(&argc, argv);
......@@ -81,4 +82,14 @@ int main(int argc, char** argv) {
close(2);
return ret;
} catch(cta::exception::Exception &ex) {
std::cerr << "Aborting: Caught a cta::exception::Exception: " << ex.getMessage().str() << std::endl;
return 1;
} catch(std::exception &se) {
std::cerr << "Aborting: Caught an std::exception: " << se.what() << std::endl;
return 1;
} catch(...) {
std::cerr << "Aborting: Caught an unknown exception " << std::endl;
return 1;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment