mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: additional method for switching error throwing on/off (issue #552)
- error::throwExceptions(bool) returning the previous state makes it easier to set and restore states. - throwing() method to query the current handling (if required). - the normal error::throwExceptions() and error::dontThrowExceptions() also return the previous state, to make it easier to restore later.
This commit is contained in:
@ -90,8 +90,8 @@ Foam::OSstream& Foam::messageStream::operator()
|
||||
{
|
||||
OSstream& os = operator OSstream&();
|
||||
|
||||
os << endl
|
||||
<< " From function " << functionName << endl
|
||||
os << nl
|
||||
<< " From function " << functionName << nl
|
||||
<< " in file " << sourceFileName
|
||||
<< " at line " << sourceFileLineNumber << endl
|
||||
<< " ";
|
||||
@ -194,7 +194,7 @@ Foam::messageStream::operator Foam::OSstream&()
|
||||
{
|
||||
if (level)
|
||||
{
|
||||
bool collect = (severity_ == INFO || severity_ == WARNING);
|
||||
const bool collect = (severity_ == INFO || severity_ == WARNING);
|
||||
|
||||
// Report the error
|
||||
if (!Pstream::master() && collect)
|
||||
|
||||
Reference in New Issue
Block a user