From 1e9d5bf0678517b9d99ac1d4d95b827baca86c44 Mon Sep 17 00:00:00 2001 From: bangerth Date: Fri, 31 Dec 2010 04:55:47 +0000 Subject: [PATCH] Use step-6 style main() function. git-svn-id: https://svn.dealii.org/trunk@23089 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-38/step-38.cc | 43 +++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/deal.II/examples/step-38/step-38.cc b/deal.II/examples/step-38/step-38.cc index 8cc31786f2..3a9066a0f9 100644 --- a/deal.II/examples/step-38/step-38.cc +++ b/deal.II/examples/step-38/step-38.cc @@ -396,19 +396,38 @@ void LaplaceBeltramiProblem::run () -int main ( int argc, char **argv ) +int main () { - deallog.depth_console (0); - - { - LaplaceBeltramiProblem<3> laplace_beltrami_3d; - laplace_beltrami_3d.run(); - } - - { - LaplaceBeltramiProblem<2> laplace_beltrami_2d; - laplace_beltrami_2d.run(); - } + try + { + deallog.depth_console (0); + + LaplaceBeltramiProblem<3> laplace_beltrami; + laplace_beltrami.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; + return 1; + } + catch (...) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Unknown exception!" << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + return 1; + } return 0; } -- 2.39.5