Add exception handlers to all tutorials and examples

This commit is contained in:
Andreas Lauser
2013-09-05 12:49:15 +02:00
parent 8638ccc604
commit 4b841fa9ec
13 changed files with 76 additions and 3 deletions
+6
View File
@@ -54,6 +54,7 @@ typedef SimulatorTraits<Isotropic, Implicit> SimTraits;
typedef SimulatorTesterFlexibleBC<SimTraits> Simulator;
int main(int argc, char** argv)
try
{
Opm::parameter::ParameterGroup param(argc, argv);
Dune::MPIHelper::instance(argc,argv);
@@ -61,4 +62,9 @@ int main(int argc, char** argv)
sim.init(param);
sim.run();
}
catch (const std::exception &e) {
std::cerr << "Program threw an exception: " << e.what() << "\n";
throw;
}