]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Provide step-61 with the usual exception catching harness 7735/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 19 Feb 2019 18:26:55 +0000 (19:26 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 19 Feb 2019 18:27:08 +0000 (19:27 +0100)
examples/step-61/step-61.cc

index 13866adf300fbecc607ea75165bf7f7de689ac2a..d62b125a7b8c8befba487520105efe2951f18fbf 100644 (file)
@@ -912,9 +912,36 @@ void WGDarcyEquation<dim>::run()
 // This is the main function. We can change the dimension here to run in 3d.
 int main()
 {
-  deallog.depth_console(2);
-  WGDarcyEquation<2> WGDarcyEquationTest;
-  WGDarcyEquationTest.run();
+  try
+    {
+      deallog.depth_console(2);
+      WGDarcyEquation<2> WGDarcyEquationTest;
+      WGDarcyEquationTest.run();
+    }
+  catch (std::exception &exc)
+    {
+      std::cerr << std::endl
+                << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+      std::cerr << "Exception on processing: " << std::endl
+                << exc.what() << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+    }
+  catch (...)
+    {
+      std::cerr << std::endl
+                << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+      std::cerr << "Unknown exception!" << std::endl
+                << "Aborting!" << std::endl
+                << "----------------------------------------------------"
+                << std::endl;
+      throw;
+    }
 
   return 0;
 }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.