Add exception handlers to all unit tests, tutorials and examples

This commit is contained in:
Andreas Lauser 2013-09-03 14:41:38 +02:00
parent 85f60ad092
commit 8ce809c400
3 changed files with 17 additions and 0 deletions

View File

@ -73,6 +73,7 @@ namespace
// ----------------- Main program -----------------
int
main(int argc, char** argv)
try
{
using namespace Opm;
@ -345,3 +346,8 @@ main(int argc, char** argv)
std::cout << "\n\n================ End of simulation ===============\n\n";
rep.report(std::cout);
}
catch (const std::exception &e) {
std::cerr << "Program threw an exception: " << e.what() << "\n";
throw;
}

View File

@ -73,6 +73,7 @@ namespace
// ----------------- Main program -----------------
int
main(int argc, char** argv)
try
{
using namespace Opm;
@ -349,3 +350,7 @@ main(int argc, char** argv)
std::cout << "\n\n================ End of simulation ===============\n\n";
rep.report(std::cout);
}
catch (const std::exception &e) {
std::cerr << "Program threw an exception: " << e.what() << "\n";
throw;
}

View File

@ -60,6 +60,7 @@
// ----------------- Main program -----------------
int
main(int argc, char** argv)
try
{
using namespace Opm;
@ -247,3 +248,8 @@ main(int argc, char** argv)
}
}
}
catch (const std::exception &e) {
std::cerr << "Program threw an exception: " << e.what() << "\n";
throw;
}