mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: use consistent naming when toggling exception throwing on/off
This commit is contained in:
@ -813,8 +813,8 @@ int main(int argc, char *argv[])
|
||||
// Whether to quit
|
||||
bool quit = false;
|
||||
|
||||
FatalError.throwExceptions();
|
||||
FatalIOError.throwExceptions();
|
||||
FatalError.throwing(true);
|
||||
FatalIOError.throwing(true);
|
||||
|
||||
do
|
||||
{
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2012-2014 OpenFOAM Foundation
|
||||
Copyright (C) 2017 OpenCFD Ltd.
|
||||
Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -63,7 +63,7 @@ int main(int argc, char *argv[])
|
||||
word utilityName(argv[1]);
|
||||
autoPtr<helpType> utility;
|
||||
|
||||
const bool throwing = FatalError.throwExceptions();
|
||||
const bool oldThrowingErr = FatalError.throwing(true);
|
||||
try
|
||||
{
|
||||
utility.reset(helpType::New(utilityName));
|
||||
@ -76,7 +76,7 @@ int main(int argc, char *argv[])
|
||||
<< err.message().c_str() << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
FatalError.throwExceptions(throwing);
|
||||
FatalError.throwing(oldThrowingErr);
|
||||
|
||||
utility().init();
|
||||
|
||||
|
||||
@ -105,8 +105,8 @@ void Foam::helpTypes::helpBoundary::fixedValueFieldConditions
|
||||
|
||||
// throw exceptions to avoid fatal errors when casting from generic patch
|
||||
// type to incompatible patch type
|
||||
FatalIOError.throwExceptions();
|
||||
FatalError.throwExceptions();
|
||||
FatalIOError.throwing(true);
|
||||
FatalError.throwing(true);
|
||||
|
||||
bool foundFixed = false;
|
||||
forAll(types, i)
|
||||
|
||||
@ -67,7 +67,7 @@ PtrList<ensightFaMesh> ensightMeshesFa(regionNames.size());
|
||||
{
|
||||
autoPtr<faMesh> faMeshPtr;
|
||||
|
||||
const bool throwing = FatalError.throwExceptions();
|
||||
const bool oldThrowingError = FatalError.throwing(true);
|
||||
try
|
||||
{
|
||||
faMeshPtr.reset(new faMesh(mesh));
|
||||
@ -76,7 +76,7 @@ PtrList<ensightFaMesh> ensightMeshesFa(regionNames.size());
|
||||
{
|
||||
faMeshPtr.reset(nullptr);
|
||||
}
|
||||
FatalError.throwExceptions(throwing);
|
||||
FatalError.throwing(oldThrowingError);
|
||||
|
||||
if (faMeshPtr)
|
||||
{
|
||||
|
||||
@ -46,7 +46,7 @@ if (doFiniteArea)
|
||||
|
||||
if (nAreaFields)
|
||||
{
|
||||
const bool throwing = FatalError.throwExceptions();
|
||||
const bool oldThrowingError = FatalError.throwing(true);
|
||||
try
|
||||
{
|
||||
faMeshPtr.reset(new faMesh(meshProxy.baseMesh()));
|
||||
@ -55,7 +55,7 @@ if (doFiniteArea)
|
||||
{
|
||||
faMeshPtr.clear();
|
||||
}
|
||||
FatalError.throwExceptions(throwing);
|
||||
FatalError.throwing(oldThrowingError);
|
||||
}
|
||||
|
||||
if (faMeshPtr && nAreaFields)
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016 OpenFOAM Foundation
|
||||
Copyright (C) 2018-2019 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -233,7 +233,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
fields.updateSelection();
|
||||
|
||||
const bool throwingIOErr = FatalIOError.throwExceptions();
|
||||
const bool oldThrowingIOErr = FatalIOError.throwing(true);
|
||||
|
||||
try
|
||||
{
|
||||
@ -258,7 +258,7 @@ int main(int argc, char *argv[])
|
||||
Info<< endl;
|
||||
|
||||
// Restore previous exception throwing state
|
||||
FatalIOError.throwExceptions(throwingIOErr);
|
||||
FatalIOError.throwing(oldThrowingIOErr);
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
Reference in New Issue
Block a user