From 4b54fb9f9d4306a55eb48fb7e943039588f43f2a Mon Sep 17 00:00:00 2001 From: Henry Weller <http://cfd.direct> Date: Wed, 11 May 2016 10:19:07 +0100 Subject: [PATCH] functionObjectList: Print the messages from errors caught during functionObject construction Exit on FatalIOError --- .../functionObjectList/functionObjectList.C | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C index 83f30b5912..0685f099c7 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C @@ -355,15 +355,26 @@ bool Foam::functionObjectList::read() { foPtr = functionObject::New(key, time_, dict); } - catch (...) - {} + catch (Foam::IOerror& ioErr) + { + Info<< ioErr << nl << endl; + ::exit(1); + } + catch (Foam::error& err) + { + WarningInFunction + << "Caught FatalError " << err << nl << endl; + } FatalError.dontThrowExceptions(); FatalIOError.dontThrowExceptions(); if (foPtr.valid()) { objPtr = foPtr.ptr(); - ok = objPtr->start() && ok; + } + else + { + ok = false; } } -- GitLab