Commit 47d3f1c3 authored by henry's avatar henry
Browse files

Improved IOerror in the same manner as error

parent 1d1fd3a3
......@@ -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();
......
......@@ -240,7 +240,7 @@ void Foam::error::abort()
// Rewind the message buffer for the next error message
messageStreamPtr_->rewind();
throw *this;
throw errorException;
}
else
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment