Go to the documentation of this file.
67 public std::exception,
73 void exitOrAbort(
const int errNo,
const bool isAbort);
102 virtual ~error() noexcept;
214 void exit(
const int errNo = 1);
221 void write(
Ostream& os,
const bool includeTitle =
true)
const;
237 label ioStartLineNumber_;
238 label ioEndLineNumber_;
244 void exitOrAbort(
const int errNo,
const bool isAbort);
271 return ioStartLineNumber_;
276 return ioEndLineNumber_;
328 void exit(
const int errNo = 1);
334 void write(
Ostream& os,
const bool includeTitle =
true)
const;
341 Ostream&
operator<<(Ostream& os,
const error& err);
344 Ostream&
operator<<(Ostream& os,
const IOerror& err);
368 #define FatalErrorIn(functionName) \
369 ::Foam::FatalError((functionName), __FILE__, __LINE__)
373 #define FatalErrorInFunction FatalErrorIn(FUNCTION_NAME)
377 #define FatalErrorInLookup(lookupTag, lookupName, lookupTable) \
378 ::Foam::FatalError(FUNCTION_NAME, __FILE__, __LINE__) \
379 << "Unknown " << (lookupTag) << " type " << (lookupName) \
380 << "\n\nValid " << (lookupTag) << " types :\n" \
381 << ((lookupTable).sortedToc()) << '\n'
387 #define FatalIOErrorIn(functionName, ios) \
388 ::Foam::FatalIOError((functionName), __FILE__, __LINE__, (ios))
393 #define FatalIOErrorInFunction(ios) FatalIOErrorIn(FUNCTION_NAME, ios)
398 #define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable) \
399 ::Foam::FatalIOError(FUNCTION_NAME, __FILE__, __LINE__, (ios)) \
400 << "Unknown " << (lookupTag) << " type " << (lookupName) \
401 << "\n\nValid " << (lookupTag) << " types :\n" \
402 << ((lookupTable).sortedToc()) << '\n'
409 #define SafeFatalIOErrorIn(functionName, ios, msg) \
410 ::Foam::IOerror::SafeFatalIOError \
411 ((functionName), __FILE__, __LINE__, (ios), (msg))
417 #define SafeFatalIOErrorInFunction(ios, msg) \
418 SafeFatalIOErrorIn(FUNCTION_NAME, ios, msg)
427 #define notImplemented(functionName) \
428 FatalErrorIn(functionName) \
429 << "Not implemented" << ::Foam::abort(FatalError);
437 #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)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
#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.
#define notImplemented(functionName)
Issue a FatalErrorIn for a function not currently implemented.
#define FatalIOErrorIn(functionName, ios)
Report an error message using Foam::FatalIOError.
Generic output stream using a standard (STL) stream.
virtual ~IOerror() noexcept
Destructor.
#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.
string message() const
The accumulated error message.
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()()
Explicit convert to OSstream for << operations.
virtual ~error() noexcept
Destructor.
label sourceFileLineNumber() const
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
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.
static void safePrintStack(std::ostream &os)