functionObjectList: Added error message for functionObject configuration file name not specified

token: Changed parseError to use cerr rather than FatalIOError so that it can
report errors when reading debug switches from the case controlDict at start-up.
This commit is contained in:
Henry Weller
2022-10-18 21:13:45 +01:00
parent f8bcaeb588
commit d01b37a949
2 changed files with 22 additions and 10 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -42,9 +42,8 @@ namespace Foam
void Foam::token::parseError(const char* expected) const void Foam::token::parseError(const char* expected) const
{ {
FatalIOError cerr<< "Parse error, expected a " << expected
<< "Parse error, expected a " << expected << ", found \n " << info() << std::endl;
<< ", found \n " << info() << endl;
} }

View File

@ -246,12 +246,25 @@ bool Foam::functionObjectList::readFunctionObject
if (path == fileName::null) if (path == fileName::null)
{ {
FatalIOErrorInFunction(functionsDict) if (funcType == word::null)
<< "Cannot find functionObject configuration file " {
<< funcType << nl << nl FatalIOErrorInFunction(functionsDict)
<< "Available configured functionObjects:" << "functionObject configuration file name not specified"
<< list() << nl << nl
<< exit(FatalIOError); << "Available configured functionObjects:"
<< list()
<< exit(FatalIOError);
}
else
{
FatalIOErrorInFunction(functionsDict)
<< "Cannot find functionObject configuration file "
<< funcType << nl << nl
<< "Available configured functionObjects:"
<< list()
<< exit(FatalIOError);
}
return false; return false;
} }