mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
dictionaryListEntryIO: Trap errors when reading entries in the list
Resolves bug-report https://bugs.openfoam.org/view.php?id=2984
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -66,7 +66,12 @@ Foam::dictionaryListEntry::dictionaryListEntry
|
|||||||
|
|
||||||
for (label i=0; i<s; i++)
|
for (label i=0; i<s; i++)
|
||||||
{
|
{
|
||||||
entry::New(*this, is);
|
if (!entry::New(*this, is))
|
||||||
|
{
|
||||||
|
FatalIOErrorInFunction(is)
|
||||||
|
<< "Failed to read dictionary entry in list"
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
is.readEndList("List");
|
is.readEndList("List");
|
||||||
}
|
}
|
||||||
@ -88,7 +93,13 @@ Foam::dictionaryListEntry::dictionaryListEntry
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
is.putBack(nextToken);
|
is.putBack(nextToken);
|
||||||
entry::New(*this, is);
|
|
||||||
|
if (!entry::New(*this, is))
|
||||||
|
{
|
||||||
|
FatalIOErrorInFunction(is)
|
||||||
|
<< "Failed to read dictionary entry in list"
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -139,7 +139,7 @@ bool Foam::entry::New(dictionary& parentDict, Istream& is)
|
|||||||
// Otherwise the token is invalid
|
// Otherwise the token is invalid
|
||||||
cerr<< "--> FOAM Warning : " << std::endl
|
cerr<< "--> FOAM Warning : " << std::endl
|
||||||
<< " From function "
|
<< " From function "
|
||||||
<< "entry::getKeyword(keyType&, Istream&)" << std::endl
|
<< "entry::New(dictionary&, Istream&)" << std::endl
|
||||||
<< " in file " << __FILE__
|
<< " in file " << __FILE__
|
||||||
<< " at line " << __LINE__ << std::endl
|
<< " at line " << __LINE__ << std::endl
|
||||||
<< " Reading " << is.name().c_str() << std::endl
|
<< " Reading " << is.name().c_str() << std::endl
|
||||||
|
|||||||
Reference in New Issue
Block a user