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" 93 <<
"error::operator OSstream&() : error stream has failed" 106 string oneLineMessage(
message());
109 errDict.
add(
"type",
word(
"Foam::error"));
110 errDict.
add(
"message", oneLineMessage);
141 <<
"\nFOAM parallel run exiting\n" <<
endl;
149 error errorException(*
this);
154 throw errorException;
159 <<
"\nFOAM exiting\n" <<
endl;
177 <<
"\nFOAM aborting (FOAM_ABORT set)\n" <<
endl;
185 <<
"\nFOAM parallel run aborting\n" <<
endl;
194 error errorException(*
this);
199 throw errorException;
204 <<
"\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)
In this string replace all occurrences of sub-string oldStr.
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.
OStringStream messageStream_
Class to handle errors and exceptions in a simple, consistent stream-based manner.
OSstream & operator()()
Explicitly convert to OSstream for << operations.
label sourceFileLineNumber_
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
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.
bool env(const word &)
Return true if environment variable of given name is defined.
A class for handling character strings derived from std::string.
label sourceFileLineNumber() const