40 functionName_(
"unknown"),
41 sourceFileName_(
"unknown"),
42 sourceFileLineNumber_(0),
43 abort_(
env(
"FOAM_ABORT")),
44 throwExceptions_(false),
50 <<
"error::error(const string& title) : cannot open error stream" 71 <<
"error::error(const dictionary& errDict) : " 72 "cannot open error stream" 124 functionName.c_str(),
136 <<
"error::operator OSstream&() : error stream has failed" 149 string oneLineMessage(
message());
152 errDict.
add(
"type",
word(
"Foam::error"));
153 errDict.
add(
"message", oneLineMessage);
184 <<
"\nFOAM parallel run exiting\n" <<
endl;
192 error errorException(*
this);
197 throw errorException;
202 <<
"\nFOAM exiting\n" <<
endl;
220 <<
"\nFOAM aborting (FOAM_ABORT set)\n" <<
endl;
228 <<
"\nFOAM parallel run aborting\n" <<
endl;
237 error errorException(*
this);
242 throw errorException;
247 <<
"\nFOAM aborting\n" <<
endl;
static void printStack(Ostream &)
Helper function to print a stack.
string & replaceAll(const string &oldStr, const string &newStr, size_type start=0)
Replace all occurrences of sub-string oldStr with newStr.
virtual ~error()
Destructor.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A list of keyword definitions, which are a keyword followed by any number of values (e...
const string & title() const
Return the title of this error type.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void rewind()
Rewind the OStringStream.
Class to handle messaging in a simple, consistent stream-based manner.
bool good() const
Return true if next operation might succeed.
void exit(const int errNo=1)
Exit : can be called for any error to exit program.
bool add(entry *, bool mergeEntry=false)
Add a new entry.
error(const string &title)
Construct from title string.
Class to handle errors and exceptions in a simple, consistent stream-based manner.
label sourceFileLineNumber_
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
stressControl lookup("compactNormalStress") >> compactNormalStress
A class for handling words, derived from string.
void abort()
Abort : used to stop code for fatal errors.
const string & functionName() const
An Ostream is an abstract base class for all output systems (streams, files, token lists...
static void exit(int errnum=1)
Exit program.
prefixOSstream Perr(cerr, "Perr")
static void abort()
Abort program.
static bool & parRun()
Is this a parallel run?
const string & sourceFileName() const
Ostream & operator<<(Ostream &, const ensightPart &)
string str() const
Return the string.
OStringStream * messageStreamPtr_
bool env(const word &)
Return true if environment variable of given name is defined.
A class for handling character strings derived from std::string.
Output to memory buffer stream.
label sourceFileLineNumber() const