From 88a608a914399de68f9c6a7dc119425cb34dae66 Mon Sep 17 00:00:00 2001 From: Soeren Peters <peters@irmb.tu-bs.de> Date: Fri, 19 Feb 2021 13:08:14 +0000 Subject: [PATCH] As bad_alloc derives from exception, we need to catch it first. --- apps/gpu/LBM/DrivenCavity/DrivenCavity.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/apps/gpu/LBM/DrivenCavity/DrivenCavity.cpp b/apps/gpu/LBM/DrivenCavity/DrivenCavity.cpp index da53c05db..19cb63009 100644 --- a/apps/gpu/LBM/DrivenCavity/DrivenCavity.cpp +++ b/apps/gpu/LBM/DrivenCavity/DrivenCavity.cpp @@ -364,16 +364,14 @@ int main( int argc, char* argv[]) ////////////////////////////////////////////////////////////////////////// } + catch (const std::bad_alloc& e) + { + *logging::out << logging::Logger::LOGGER_ERROR << "Bad Alloc:" << e.what() << "\n"; + } catch (const std::exception& e) - { - + { *logging::out << logging::Logger::LOGGER_ERROR << e.what() << "\n"; } - catch (const std::bad_alloc e) - { - - *logging::out << logging::Logger::LOGGER_ERROR << "Bad Alloc:" << e.what() << "\n"; - } catch (...) { *logging::out << logging::Logger::LOGGER_ERROR << "Unknown exception!\n"; -- GitLab