Go to the documentation of this file.
73 public std::exception,
79 void exitOrAbort(
const int errNo,
const bool isAbort);
108 virtual ~error() noexcept;
223 void exit(
const int errNo = 1);
230 void write(
Ostream& os,
const bool includeTitle =
true)
const;
246 label ioStartLineNumber_;
247 label ioEndLineNumber_;
253 void exitOrAbort(
const int errNo,
const bool isAbort);
280 return ioStartLineNumber_;
285 return ioEndLineNumber_;
337 void exit(
const int errNo = 1);
343 void write(
Ostream& os,
const bool includeTitle =
true)
const;
350 Ostream&
operator<<(Ostream& os,
const error& err);
353 Ostream&
operator<<(Ostream& os,
const IOerror& err);
377 #define FatalErrorIn(functionName) \
378 ::Foam::FatalError((functionName), __FILE__, __LINE__)
382 #define FatalErrorInFunction FatalErrorIn(FUNCTION_NAME)
386 #define FatalErrorInLookup(lookupTag, lookupName, lookupTable) \
387 ::Foam::FatalError(FUNCTION_NAME, __FILE__, __LINE__) \
388 << "Unknown " << (lookupTag) << " type " << (lookupName) \
389 << "\n\nValid " << (lookupTag) << " types :\n" \
390 << ((lookupTable).sortedToc()) << '\n'
396 #define FatalIOErrorIn(functionName, ios) \
397 ::Foam::FatalIOError((functionName), __FILE__, __LINE__, (ios))
402 #define FatalIOErrorInFunction(ios) FatalIOErrorIn(FUNCTION_NAME, ios)
407 #define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable) \
408 ::Foam::FatalIOError(FUNCTION_NAME, __FILE__, __LINE__, (ios)) \
409 << "Unknown " << (lookupTag) << " type " << (lookupName) \
410 << "\n\nValid " << (lookupTag) << " types :\n" \
411 << ((lookupTable).sortedToc()) << '\n'
418 #define SafeFatalIOErrorIn(functionName, ios, msg) \
419 ::Foam::IOerror::SafeFatalIOError \
420 ((functionName), __FILE__, __LINE__, (ios), (msg))
426 #define SafeFatalIOErrorInFunction(ios, msg) \
427 SafeFatalIOErrorIn(FUNCTION_NAME, ios, msg)
436 #define notImplemented(functionName) \
437 FatalErrorIn(functionName) \
438 << "Not implemented" << ::Foam::abort(FatalError);
446 #define NotImplemented notImplemented(FUNCTION_NAME)
label ioEndLineNumber() const
const string & sourceFileName() const
static void printStack(Ostream &os)
Helper function to print a stack.
std::unique_ptr< OStringStream > messageStreamPtr_
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_
static bool useAbort()
True if FOAM_ABORT is on.
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.
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)