37 ioFileName_(
"unknown"),
38 ioStartLineNumber_(-1),
46 const string& ioFileName,
47 const label ioStartLineNumber,
48 const label ioEndLineNumber,
52 ioFileName_(ioFileName),
53 ioStartLineNumber_(ioStartLineNumber),
54 ioEndLineNumber_(ioEndLineNumber),
61 ioFileName_(ios.
name()),
62 ioStartLineNumber_(ios.lineNumber()),
71 ioStartLineNumber_(
dict.startLineNumber()),
72 ioEndLineNumber_(
dict.endLineNumber()),
73 ioGlobal_(
dict.global())
87 const char* sourceFileName,
88 const int sourceFileLineNumber,
94 IOerrorLocation::operator=(location);
103 const char* sourceFileName,
104 const int sourceFileLineNumber,
115 sourceFileLineNumber,
123 <<
"--> FOAM FATAL IO ERROR:" <<
std::endl
126 <<
"file: " << ioStream.
name()
127 <<
" at line " << ioStream.
lineNumber() <<
'.'
131 <<
" in file " << sourceFileName
132 <<
" at line " << sourceFileLineNumber <<
'.'
143 errDict.remove(
"type");
144 errDict.add(
"type",
word(
"Foam::IOerror"));
146 errDict.add(
"ioFileName", ioFileName());
147 errDict.add(
"ioStartLineNumber", ioStartLineNumber());
148 errDict.add(
"ioEndLineNumber", ioEndLineNumber());
174 <<
"\nFOAM parallel run exiting\n" <<
endl;
180 <<
"\nFOAM parallel run exiting\n" <<
endl;
187 if (throwExceptions_)
193 messageStream_.rewind();
195 throw errorException;
200 <<
"\nFOAM exiting\n" <<
endl;
218 <<
"\nFOAM aborting (FOAM_ABORT set)\n" <<
endl;
230 <<
"\nFOAM parallel run aborting\n" <<
endl;
237 <<
"\nFOAM parallel run aborting\n" <<
endl;
245 if (throwExceptions_)
251 messageStream_.rewind();
253 throw errorException;
258 <<
"\nFOAM aborting\n" <<
endl;
const string & ioFileName() const
Access the file name.
IOerrorLocation()
Construct null.
label ioEndLineNumber() const
Access the end line number.
label ioStartLineNumber() const
Access the start line number.
static void SafeFatalIOError(const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const IOstream &, const string &msg)
Print basic message and exit. Uses cerr if streams not constructed.
void exit(const int errNo=1)
Exit : can be called for any error to exit program.
IOerror(const string &title)
Construct from title string.
void abort()
Abort : used to stop code for fatal errors.
An IOstream is an abstract base class for all input/output systems; be they streams,...
label lineNumber() const
Return current stream line number.
virtual const fileName & name() const
Return the name of the stream.
bool bad() const
Return true if stream is corrupted.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static bool master(const label communicator=0)
Am I the master process.
static void abort()
Abort program.
static bool & parRun()
Is this a parallel run?
static void exit(int errnum=1)
Exit program.
A list of keyword definitions, which are a keyword followed by any number of values (e....
bool add(entry *, bool mergeEntry=false)
Add a new entry.
Class to handle errors and exceptions in a simple, consistent stream-based manner.
const string & sourceFileName() const
const string & functionName() const
OSstream & operator()()
Explicitly convert to OSstream for << operations.
label sourceFileLineNumber() const
A functionName is a word starting with '#'.
const string & title() const
Return the title of this error type.
A class for handling words, derived from string.
errorManipArg< error, int > exit(error &err, const int errNo=1)
prefixOSstream Perr(cerr, "Perr")
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
errorManip< error > abort(error &err)
OSstream Serr(cerr, "Serr")
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)