src/OpenFOAM: Update ...ErrorIn -> ...ErrorInFunction
Avoids the clutter and maintenance effort associated with providing the function signature string.
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -61,11 +61,8 @@ void Foam::dynamicCode::checkSecurity
|
||||
{
|
||||
if (isAdministrator())
|
||||
{
|
||||
FatalIOErrorIn
|
||||
(
|
||||
title,
|
||||
dict
|
||||
) << "This code should not be executed by someone with administrator"
|
||||
FatalIOErrorInFunction(dict)
|
||||
<< "This code should not be executed by someone with administrator"
|
||||
<< " rights due to security reasons." << nl
|
||||
<< "(it writes a shared library which then gets loaded "
|
||||
<< "using dlopen)"
|
||||
@ -74,11 +71,8 @@ void Foam::dynamicCode::checkSecurity
|
||||
|
||||
if (!allowSystemOperations)
|
||||
{
|
||||
FatalIOErrorIn
|
||||
(
|
||||
title,
|
||||
dict
|
||||
) << "Loading a shared library using case-supplied code is not"
|
||||
FatalIOErrorInFunction(dict)
|
||||
<< "Loading a shared library using case-supplied code is not"
|
||||
<< " enabled by default" << nl
|
||||
<< "because of security issues. If you trust the code you can"
|
||||
<< " enable this" << nl
|
||||
@ -115,21 +109,15 @@ void Foam::dynamicCode::copyAndFilter
|
||||
{
|
||||
if (!is.good())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"dynamicCode::copyAndFilter()"
|
||||
" const"
|
||||
) << "Failed opening for reading " << is.name()
|
||||
FatalErrorInFunction
|
||||
<< "Failed opening for reading " << is.name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
if (!os.good())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"dynamicCode::copyAndFilter()"
|
||||
" const"
|
||||
) << "Failed writing " << os.name()
|
||||
FatalErrorInFunction
|
||||
<< "Failed writing " << os.name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -226,11 +214,8 @@ bool Foam::dynamicCode::createMakeFiles() const
|
||||
//Info<< "Writing to " << dstFile << endl;
|
||||
if (!os.good())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"dynamicCode::createMakeFiles()"
|
||||
" const"
|
||||
) << "Failed writing " << dstFile
|
||||
FatalErrorInFunction
|
||||
<< "Failed writing " << dstFile
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -266,11 +251,8 @@ bool Foam::dynamicCode::createMakeOptions() const
|
||||
//Info<< "Writing to " << dstFile << endl;
|
||||
if (!os.good())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"dynamicCode::createMakeOptions()"
|
||||
" const"
|
||||
) << "Failed writing " << dstFile
|
||||
FatalErrorInFunction
|
||||
<< "Failed writing " << dstFile
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -432,10 +414,8 @@ bool Foam::dynamicCode::copyOrCreateFiles(const bool verbose) const
|
||||
|
||||
if (!badFiles.empty())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"dynamicCode::copyFilesContents(..)"
|
||||
) << "Could not find the code template(s): "
|
||||
FatalErrorInFunction
|
||||
<< "Could not find the code template(s): "
|
||||
<< badFiles << nl
|
||||
<< "Under the $" << codeTemplateEnvName
|
||||
<< " directory or via via the ~OpenFOAM/"
|
||||
@ -461,11 +441,8 @@ bool Foam::dynamicCode::copyOrCreateFiles(const bool verbose) const
|
||||
//Info<< "Reading from " << is.name() << endl;
|
||||
if (!is.good())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"dynamicCode::copyFilesContents(const fileName&)"
|
||||
" const"
|
||||
) << "Failed opening " << srcFile
|
||||
FatalErrorInFunction
|
||||
<< "Failed opening " << srcFile
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -473,11 +450,8 @@ bool Foam::dynamicCode::copyOrCreateFiles(const bool verbose) const
|
||||
//Info<< "Writing to " << dstFile.name() << endl;
|
||||
if (!os.good())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"dynamicCode::copyFilesContents(const fileName&)"
|
||||
" const"
|
||||
) << "Failed writing " << dstFile
|
||||
FatalErrorInFunction
|
||||
<< "Failed writing " << dstFile
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -499,11 +473,8 @@ bool Foam::dynamicCode::copyOrCreateFiles(const bool verbose) const
|
||||
//Info<< "Writing to " << createFiles_[fileI].first() << endl;
|
||||
if (!os.good())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"dynamicCode::copyOrCreateFiles()"
|
||||
" const"
|
||||
) << "Failed writing " << dstFile
|
||||
FatalErrorInFunction
|
||||
<< "Failed writing " << dstFile
|
||||
<< exit(FatalError);
|
||||
}
|
||||
os.writeQuoted(createFiles_[fileI].second(), false) << nl;
|
||||
|
||||
Reference in New Issue
Block a user