OpenFOAM library: Add better error messaging from compound token transfer

This commit is contained in:
Henry
2011-08-06 23:35:28 +01:00
parent 90780e09e3
commit 61db7b5bad
7 changed files with 18 additions and 151 deletions

View File

@ -63,11 +63,11 @@ Foam::autoPtr<Foam::token::compound> Foam::token::compound::New
if (cstrIter == IstreamConstructorTablePtr_->end())
{
FatalErrorIn("token::compound::New(const word&, Istream&)")
FatalIOErrorIn("token::compound::New(const word&, Istream&)", is)
<< "Unknown compound type " << compoundType << nl << nl
<< "Valid compound types:" << endl
<< IstreamConstructorTablePtr_->sortedToc()
<< abort(FatalError);
<< abort(FatalIOError);
}
return autoPtr<Foam::token::compound>(cstrIter()(is));
@ -86,15 +86,15 @@ bool Foam::token::compound::isCompound(const word& name)
}
Foam::token::compound& Foam::token::transferCompoundToken()
Foam::token::compound& Foam::token::transferCompoundToken(const Istream& is)
{
if (type_ == COMPOUND)
{
if (compoundTokenPtr_->empty())
{
FatalErrorIn("token::transferCompoundToken()")
FatalIOErrorIn("token::transferCompoundToken(const Istream& is)", is)
<< "compound has already been transfered from token\n "
<< info() << abort(FatalError);
<< info() << abort(FatalIOError);
}
else
{