From a1ba1042970bfbb815774dc4866bb3e6c6a5abff Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Tue, 19 Feb 2019 19:26:55 +0100 Subject: [PATCH] Provide step-61 with the usual exception catching harness --- examples/step-61/step-61.cc | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/examples/step-61/step-61.cc b/examples/step-61/step-61.cc index 13866adf30..d62b125a7b 100644 --- a/examples/step-61/step-61.cc +++ b/examples/step-61/step-61.cc @@ -912,9 +912,36 @@ void WGDarcyEquation::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; } -- 2.39.5