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:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -42,9 +42,8 @@ namespace Foam
|
||||
|
||||
void Foam::token::parseError(const char* expected) const
|
||||
{
|
||||
FatalIOError
|
||||
<< "Parse error, expected a " << expected
|
||||
<< ", found \n " << info() << endl;
|
||||
cerr<< "Parse error, expected a " << expected
|
||||
<< ", found \n " << info() << std::endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -245,6 +245,17 @@ bool Foam::functionObjectList::readFunctionObject
|
||||
fileName path = findDict(funcType, region);
|
||||
|
||||
if (path == fileName::null)
|
||||
{
|
||||
if (funcType == word::null)
|
||||
{
|
||||
FatalIOErrorInFunction(functionsDict)
|
||||
<< "functionObject configuration file name not specified"
|
||||
<< nl << nl
|
||||
<< "Available configured functionObjects:"
|
||||
<< list()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalIOErrorInFunction(functionsDict)
|
||||
<< "Cannot find functionObject configuration file "
|
||||
@ -252,6 +263,8 @@ bool Foam::functionObjectList::readFunctionObject
|
||||
<< "Available configured functionObjects:"
|
||||
<< list()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user