NeoFOAM
WIP Prototype of a modern OpenFOAM core
Loading...
Searching...
No Matches
Public Member Functions | List of all members
NeoFOAM::Error Class Reference

Base class for consistent error representation. More...

#include <exceptions.hpp>

Inheritance diagram for NeoFOAM::Error:
NeoFOAM::DimensionMismatch

Public Member Functions

 Error (const std::string &file, int line, const std::string &what)
 
virtual const char * what () const noexcept override
 

Detailed Description

Base class for consistent error representation.

The Error class is used to report exceptional behaviour in library functions. NeoFOAM uses C++ exception mechanism to this end, and the Error class represents a base class for all types of errors. The exact list of errors which could occur during the execution of a certain library routine is provided in the documentation of that routine, along with a short description of the situation when that error can occur. During runtime, these errors can be detected by using standard C++ try-catch blocks, and a human-readable error description can be obtained by calling the Error::what() method.

Definition at line 23 of file exceptions.hpp.

Constructor & Destructor Documentation

◆ Error()

NeoFOAM::Error::Error ( const std::string &  file,
int  line,
const std::string &  what 
)
inline

Initializes an error.

Parameters
fileThe name of the offending source file
lineThe source code line number where the error occurred
whatThe error message

Definition at line 34 of file exceptions.hpp.

Member Function Documentation

◆ what()

virtual const char * NeoFOAM::Error::what ( ) const
inlineoverridevirtualnoexcept

Returns a human-readable string with a more detailed description of the error.

Definition at line 42 of file exceptions.hpp.


The documentation for this class was generated from the following file: