ENH: dictionary.C : use FatalIOError instead of FatalError.

This commit is contained in:
mattijs
2011-02-16 11:53:02 +00:00
parent ac7c938c95
commit 8a0938ae25

View File

@ -741,13 +741,14 @@ bool Foam::dictionary::changeKeyword
if (iter()->keyword().isPattern())
{
FatalErrorIn
FatalIOErrorIn
(
"dictionary::changeKeyword(const word&, const word&, bool)"
"dictionary::changeKeyword(const word&, const word&, bool)",
*this
) << "Old keyword "<< oldKeyword
<< " is a pattern."
<< "Pattern replacement not yet implemented."
<< exit(FatalError);
<< exit(FatalIOError);
}
@ -781,9 +782,10 @@ bool Foam::dictionary::changeKeyword
}
else
{
WarningIn
IOWarningIn
(
"dictionary::changeKeyword(const word&, const word&, bool)"
"dictionary::changeKeyword(const word&, const word&, bool)",
*this
) << "cannot rename keyword "<< oldKeyword
<< " to existing keyword " << newKeyword
<< " in dictionary " << name() << endl;
@ -815,9 +817,9 @@ bool Foam::dictionary::merge(const dictionary& dict)
// Check for assignment to self
if (this == &dict)
{
FatalErrorIn("dictionary::merge(const dictionary&)")
FatalIOErrorIn("dictionary::merge(const dictionary&)", *this)
<< "attempted merge to self for dictionary " << name()
<< abort(FatalError);
<< abort(FatalIOError);
}
bool changed = false;
@ -896,9 +898,9 @@ void Foam::dictionary::operator=(const dictionary& rhs)
// Check for assignment to self
if (this == &rhs)
{
FatalErrorIn("dictionary::operator=(const dictionary&)")
FatalIOErrorIn("dictionary::operator=(const dictionary&)", *this)
<< "attempted assignment to self for dictionary " << name()
<< abort(FatalError);
<< abort(FatalIOError);
}
name() = rhs.name();
@ -919,9 +921,9 @@ void Foam::dictionary::operator+=(const dictionary& rhs)
// Check for assignment to self
if (this == &rhs)
{
FatalErrorIn("dictionary::operator+=(const dictionary&)")
FatalIOErrorIn("dictionary::operator+=(const dictionary&)", *this)
<< "attempted addition assignment to self for dictionary " << name()
<< abort(FatalError);
<< abort(FatalIOError);
}
forAllConstIter(IDLList<entry>, rhs, iter)
@ -936,9 +938,9 @@ void Foam::dictionary::operator|=(const dictionary& rhs)
// Check for assignment to self
if (this == &rhs)
{
FatalErrorIn("dictionary::operator|=(const dictionary&)")
FatalIOErrorIn("dictionary::operator|=(const dictionary&)", *this)
<< "attempted assignment to self for dictionary " << name()
<< abort(FatalError);
<< abort(FatalIOError);
}
forAllConstIter(IDLList<entry>, rhs, iter)
@ -956,9 +958,9 @@ void Foam::dictionary::operator<<=(const dictionary& rhs)
// Check for assignment to self
if (this == &rhs)
{
FatalErrorIn("dictionary::operator<<=(const dictionary&)")
FatalIOErrorIn("dictionary::operator<<=(const dictionary&)", *this)
<< "attempted assignment to self for dictionary " << name()
<< abort(FatalError);
<< abort(FatalIOError);
}
forAllConstIter(IDLList<entry>, rhs, iter)