error.H File Reference
Include dependency graph for error.H:

Go to the source code of this file.

Classes

class  error
 Class to handle errors and exceptions in a simple, consistent stream-based manner. More...
 
class  IOerror
 Report an I/O error. More...
 

Namespaces

 Foam
 Namespace for OpenFOAM.
 

Macros

#define FatalErrorIn(functionName)    ::Foam::FatalError((functionName), __FILE__, __LINE__)
 Report an error message using Foam::FatalError. More...
 
#define FatalErrorInFunction   FatalErrorIn(FUNCTION_NAME)
 Report an error message using Foam::FatalError. More...
 
#define FatalIOErrorIn(functionName, ios)    ::Foam::FatalIOError((functionName), __FILE__, __LINE__, (ios))
 Report an error message using Foam::FatalIOError. More...
 
#define FatalIOErrorInFunction(ios)   FatalIOErrorIn(FUNCTION_NAME, ios)
 Report an error message using Foam::FatalIOError. More...
 
#define SafeFatalIOErrorIn(functionName, ios, msg)
 Report an error message using Foam::FatalIOError. More...
 
#define SafeFatalIOErrorInFunction(ios, msg)    SafeFatalIOErrorIn(FUNCTION_NAME, ios, msg)
 Report an error message using Foam::FatalIOError. More...
 
#define notImplemented(functionName)
 Issue a FatalErrorIn for a function not currently implemented. More...
 
#define NotImplemented   notImplemented(FUNCTION_NAME)
 Issue a FatalErrorIn for a function not currently implemented. More...
 

Functions

Ostream & operator<< (Ostream &, const error &)
 
Ostream & operator<< (Ostream &, const IOerror &)
 

Variables

error FatalError
 
IOerror FatalIOError
 
template<class... T>
constexpr bool False = false
 

Detailed Description

Original source file error.H

Definition in file error.H.

Macro Definition Documentation

◆ FatalErrorIn

#define FatalErrorIn (   functionName)     ::Foam::FatalError((functionName), __FILE__, __LINE__)

Report an error message using Foam::FatalError.

for functionName in file __FILE__ at line __LINE__

Definition at line 301 of file error.H.

◆ FatalErrorInFunction

#define FatalErrorInFunction   FatalErrorIn(FUNCTION_NAME)

Report an error message using Foam::FatalError.

for FUNCTION_NAME in file __FILE__ at line __LINE__

Definition at line 306 of file error.H.

◆ FatalIOErrorIn

#define FatalIOErrorIn (   functionName,
  ios 
)     ::Foam::FatalIOError((functionName), __FILE__, __LINE__, (ios))

Report an error message using Foam::FatalIOError.

for functionName in file __FILE__ at line __LINE__ for a particular IOstream

Definition at line 312 of file error.H.

◆ FatalIOErrorInFunction

#define FatalIOErrorInFunction (   ios)    FatalIOErrorIn(FUNCTION_NAME, ios)

Report an error message using Foam::FatalIOError.

for FUNCTION_NAME in file __FILE__ at line __LINE__ for a particular IOstream

Definition at line 318 of file error.H.

◆ SafeFatalIOErrorIn

#define SafeFatalIOErrorIn (   functionName,
  ios,
  msg 
)
Value:
((functionName), __FILE__, __LINE__, (ios), (msg))
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.
Definition: IOerror.C:105

Report an error message using Foam::FatalIOError.

(or cerr if FatalIOError not yet constructed) for functionName in file __FILE__ at line __LINE__ for a particular IOstream

Definition at line 325 of file error.H.

◆ SafeFatalIOErrorInFunction

#define SafeFatalIOErrorInFunction (   ios,
  msg 
)     SafeFatalIOErrorIn(FUNCTION_NAME, ios, msg)

Report an error message using Foam::FatalIOError.

(or cerr if FatalIOError not yet constructed) for functionName in file __FILE__ at line __LINE__ for a particular IOstream

Definition at line 333 of file error.H.

◆ notImplemented

#define notImplemented (   functionName)
Value:
FatalErrorIn(functionName) \
<< "Not implemented" << ::Foam::abort(::Foam::FatalError);
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
Definition: error.H:301
errorManip< error > abort(error &err)
Definition: errorManip.H:131
error FatalError

Issue a FatalErrorIn for a function not currently implemented.

The functionName is printed and then abort is called.

This macro can be particularly useful when methods must be defined to complete the interface of a derived class even if they should never be called for this derived class.

Definition at line 343 of file error.H.

◆ NotImplemented

#define NotImplemented   notImplemented(FUNCTION_NAME)

Issue a FatalErrorIn for a function not currently implemented.

The FUNCTION_NAME is printed and then abort is called.

This macro can be particularly useful when methods must be defined to complete the interface of a derived class even if they should never be called for this derived class.

Definition at line 353 of file error.H.