mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Improved IOerror in the same manner as error
This commit is contained in:
@ -139,10 +139,7 @@ void Foam::IOerror::exit(const int)
|
||||
|
||||
if (abort_)
|
||||
{
|
||||
Perr<< endl << *this << endl
|
||||
<< "\nFOAM aborting (FOAM_ABORT set)\n" << endl;
|
||||
printStack(Perr);
|
||||
::abort();
|
||||
abort();
|
||||
}
|
||||
|
||||
if (Pstream::parRun())
|
||||
@ -155,7 +152,13 @@ void Foam::IOerror::exit(const int)
|
||||
{
|
||||
if (throwExceptions_)
|
||||
{
|
||||
throw *this;
|
||||
// Make a copy of the error to throw
|
||||
IOerror errorException(*this);
|
||||
|
||||
// Rewind the message buffer for the next error message
|
||||
messageStreamPtr_->rewind();
|
||||
|
||||
throw errorException;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -194,7 +197,13 @@ void Foam::IOerror::abort()
|
||||
{
|
||||
if (throwExceptions_)
|
||||
{
|
||||
throw *this;
|
||||
// Make a copy of the error to throw
|
||||
IOerror errorException(*this);
|
||||
|
||||
// Rewind the message buffer for the next error message
|
||||
messageStreamPtr_->rewind();
|
||||
|
||||
throw errorException;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -209,7 +218,9 @@ void Foam::IOerror::abort()
|
||||
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const IOerror& ioErr)
|
||||
{
|
||||
os << endl << ioErr.message().c_str() << endl << endl;
|
||||
os << endl
|
||||
<< ioErr.title().c_str() << endl
|
||||
<< ioErr.message().c_str() << endl << endl;
|
||||
|
||||
os << "file: " << ioErr.ioFileName().c_str();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user