Go to the documentation of this file.
67 public std::exception,
203 void exit(
const int errNo = 1);
210 void write(
Ostream& os,
const bool includeTitle =
true)
const;
226 label ioStartLineNumber_;
227 label ioEndLineNumber_;
254 return ioStartLineNumber_;
259 return ioEndLineNumber_;
311 void exit(
const int errNo = 1);
317 void write(
Ostream& os,
const bool includeTitle =
true)
const;
324 Ostream&
operator<<(Ostream& os,
const error& err);
327 Ostream&
operator<<(Ostream& os,
const IOerror& err);
351 #define FatalErrorIn(functionName) \
352 ::Foam::FatalError((functionName), __FILE__, __LINE__)
356 #define FatalErrorInFunction FatalErrorIn(FUNCTION_NAME)
360 #define FatalErrorInLookup(lookupTag, lookupName, lookupTable) \
361 ::Foam::FatalError(FUNCTION_NAME, __FILE__, __LINE__) \
362 << "Unknown " << (lookupTag) << " type " << (lookupName) \
363 << "\n\nValid " << (lookupTag) << " types :\n" \
364 << ((lookupTable).sortedToc()) << '\n'
370 #define FatalIOErrorIn(functionName, ios) \
371 ::Foam::FatalIOError((functionName), __FILE__, __LINE__, (ios))
376 #define FatalIOErrorInFunction(ios) FatalIOErrorIn(FUNCTION_NAME, ios)
381 #define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable) \
382 ::Foam::FatalIOError(FUNCTION_NAME, __FILE__, __LINE__, (ios)) \
383 << "Unknown " << (lookupTag) << " type " << (lookupName) \
384 << "\n\nValid " << (lookupTag) << " types :\n" \
385 << ((lookupTable).sortedToc()) << '\n'
392 #define SafeFatalIOErrorIn(functionName, ios, msg) \
393 ::Foam::IOerror::SafeFatalIOError \
394 ((functionName), __FILE__, __LINE__, (ios), (msg))
400 #define SafeFatalIOErrorInFunction(ios, msg) \
401 SafeFatalIOErrorIn(FUNCTION_NAME, ios, msg)
410 #define notImplemented(functionName) \
411 FatalErrorIn(functionName) \
412 << "Not implemented" << ::Foam::abort(FatalError);
420 #define NotImplemented notImplemented(FUNCTION_NAME)
label ioEndLineNumber() const
const string & sourceFileName() const
static void printStack(Ostream &os)
Helper function to print a stack.
bool dontThrowExceptions()
Deactivate exception throwing.
void abort()
Abort : used to stop code for fatal errors.
bool throwExceptions()
Activate exception throwing.
Class to handle messaging in a simple, consistent stream-based manner.
IOerror(const string &title)
Construct from title string.
An IOstream is an abstract base class for all input/output systems; be they streams,...
label ioStartLineNumber() const
const string & functionName() const
#define SafeFatalIOErrorIn(functionName, ios, msg)
Report an error message using Foam::FatalIOError.
bool throwing() const
Return the current exception throwing (on or off)
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
static void SafeFatalIOError(const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const IOstream &ioStream, const string &msg)
Print basic message and exit.
const string & ioFileName() const
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
error(const string &title)
Construct from title string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual ~IOerror()
Destructor.
#define notImplemented(functionName)
Issue a FatalErrorIn for a function not currently implemented.
#define FatalIOErrorIn(functionName, ios)
Report an error message using Foam::FatalIOError.
#define SafeFatalIOErrorInFunction(ios, msg)
Report an error message using Foam::FatalIOError.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
#define FatalErrorInLookup(lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalError.
label sourceFileLineNumber_
void exit(const int errNo=1)
Exit : can be called for any error to exit program.
const std::string version
OpenFOAM version (name or stringified number) as a std::string.
OSstream & operator()()
Explicitly convert to OSstream for << operations.
label sourceFileLineNumber() const
virtual ~error()
Destructor.
void exit(const int errNo=1)
Exit : can be called for any error to exit program.
static void warnAboutAge(const char *what, const int version)
Emit warning on stderr about something being old.
void abort()
Abort : used to stop code for fatal errors.
void write(Ostream &os, const bool includeTitle=true) const
Print error message.
Output to string buffer, using a OSstream.
OStringStream * messageStreamPtr_
void clear() const
Clear any messages.
const string & title() const
Return the title of this error type.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
void write(Ostream &os, const bool includeTitle=true) const
Print error message.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Class to handle errors and exceptions in a simple, consistent stream-based manner.
Ostream & operator<<(Ostream &, const boundaryPatch &)
static void safePrintStack(std::ostream &os)