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 FatalErrorInLookup(lookupTag, lookupName, lookupTable)
 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 FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
 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 &os, const error &err)
 Ostream operator. More...
 
Ostream & operator<< (Ostream &os, const IOerror &err)
 Ostream operator. More...
 

Variables

error FatalError
 
IOerror FatalIOError
 

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 448 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 453 of file error.H.

◆ FatalErrorInLookup

#define FatalErrorInLookup (   lookupTag,
  lookupName,
  lookupTable 
)
Value:
::Foam::FatalError(FUNCTION_NAME, __FILE__, __LINE__) \
<< "Unknown " << (lookupTag) << " type " << (lookupName) \
<< "\n\nValid " << (lookupTag) << " types :\n" \
<< ((lookupTable).sortedToc()) << '\n'

Report an error message using Foam::FatalError.

about unknown lookup type in table

Definition at line 457 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 467 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 473 of file error.H.

◆ FatalIOErrorInLookup

#define FatalIOErrorInLookup (   ios,
  lookupTag,
  lookupName,
  lookupTable 
)
Value:
::Foam::FatalIOError(FUNCTION_NAME, __FILE__, __LINE__, (ios)) \
<< "Unknown " << (lookupTag) << " type " << (lookupName) \
<< "\n\nValid " << (lookupTag) << " types :\n" \
<< ((lookupTable).sortedToc()) << '\n'

Report an error message using Foam::FatalIOError.

about unknown lookup type in table

Definition at line 478 of file error.H.

◆ SafeFatalIOErrorIn

#define SafeFatalIOErrorIn (   functionName,
  ios,
  msg 
)
Value:
((functionName), __FILE__, __LINE__, (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 489 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 497 of file error.H.

◆ notImplemented

#define notImplemented (   functionName)
Value:
FatalErrorIn(functionName) \
<< "Not implemented" << ::Foam::abort(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 507 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 517 of file error.H.

Foam::FatalIOError
IOerror FatalIOError
Foam::IOerror::SafeFatalIOError
static void SafeFatalIOError(const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const IOstream &ioStream, const string &msg)
Print basic message and exit.
Definition: IOerror.C:166
Foam::FatalError
error FatalError
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:144
FUNCTION_NAME
#define FUNCTION_NAME
Definition: messageStream.H:295
FatalErrorIn
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
Definition: error.H:448