mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Foam abort - reading from env(FOAM_ABORT) instead of caching value on construction
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -174,7 +174,7 @@ void Foam::IOerror::exit(const int)
|
|||||||
jobInfo.exit();
|
jobInfo.exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (abort_)
|
if (env("FOAM_ABORT"))
|
||||||
{
|
{
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
@ -215,7 +215,7 @@ void Foam::IOerror::abort()
|
|||||||
jobInfo.abort();
|
jobInfo.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (abort_)
|
if (env("FOAM_ABORT"))
|
||||||
{
|
{
|
||||||
Perr<< endl << *this << endl
|
Perr<< endl << *this << endl
|
||||||
<< "\nFOAM aborting (FOAM_ABORT set)\n" << endl;
|
<< "\nFOAM aborting (FOAM_ABORT set)\n" << endl;
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -40,7 +40,6 @@ Foam::error::error(const string& title)
|
|||||||
functionName_("unknown"),
|
functionName_("unknown"),
|
||||||
sourceFileName_("unknown"),
|
sourceFileName_("unknown"),
|
||||||
sourceFileLineNumber_(0),
|
sourceFileLineNumber_(0),
|
||||||
abort_(env("FOAM_ABORT")),
|
|
||||||
throwExceptions_(false),
|
throwExceptions_(false),
|
||||||
messageStreamPtr_(new OStringStream())
|
messageStreamPtr_(new OStringStream())
|
||||||
{
|
{
|
||||||
@ -61,7 +60,6 @@ Foam::error::error(const dictionary& errDict)
|
|||||||
functionName_(errDict.lookup("functionName")),
|
functionName_(errDict.lookup("functionName")),
|
||||||
sourceFileName_(errDict.lookup("sourceFileName")),
|
sourceFileName_(errDict.lookup("sourceFileName")),
|
||||||
sourceFileLineNumber_(readLabel(errDict.lookup("sourceFileLineNumber"))),
|
sourceFileLineNumber_(readLabel(errDict.lookup("sourceFileLineNumber"))),
|
||||||
abort_(env("FOAM_ABORT")),
|
|
||||||
throwExceptions_(false),
|
throwExceptions_(false),
|
||||||
messageStreamPtr_(new OStringStream())
|
messageStreamPtr_(new OStringStream())
|
||||||
{
|
{
|
||||||
@ -83,7 +81,6 @@ Foam::error::error(const error& err)
|
|||||||
functionName_(err.functionName_),
|
functionName_(err.functionName_),
|
||||||
sourceFileName_(err.sourceFileName_),
|
sourceFileName_(err.sourceFileName_),
|
||||||
sourceFileLineNumber_(err.sourceFileLineNumber_),
|
sourceFileLineNumber_(err.sourceFileLineNumber_),
|
||||||
abort_(err.abort_),
|
|
||||||
throwExceptions_(err.throwExceptions_),
|
throwExceptions_(err.throwExceptions_),
|
||||||
messageStreamPtr_(new OStringStream(*err.messageStreamPtr_))
|
messageStreamPtr_(new OStringStream(*err.messageStreamPtr_))
|
||||||
{
|
{
|
||||||
@ -173,7 +170,7 @@ void Foam::error::exit(const int errNo)
|
|||||||
jobInfo.exit();
|
jobInfo.exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (abort_)
|
if (env("FOAM_ABORT"))
|
||||||
{
|
{
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
@ -214,7 +211,7 @@ void Foam::error::abort()
|
|||||||
jobInfo.abort();
|
jobInfo.abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (abort_)
|
if (env("FOAM_ABORT"))
|
||||||
{
|
{
|
||||||
Perr<< endl << *this << endl
|
Perr<< endl << *this << endl
|
||||||
<< "\nFOAM aborting (FOAM_ABORT set)\n" << endl;
|
<< "\nFOAM aborting (FOAM_ABORT set)\n" << endl;
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -78,11 +78,10 @@ protected:
|
|||||||
string sourceFileName_;
|
string sourceFileName_;
|
||||||
label sourceFileLineNumber_;
|
label sourceFileLineNumber_;
|
||||||
|
|
||||||
bool abort_;
|
|
||||||
|
|
||||||
bool throwExceptions_;
|
bool throwExceptions_;
|
||||||
OStringStream* messageStreamPtr_;
|
OStringStream* messageStreamPtr_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|||||||
Reference in New Issue
Block a user