mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-26 05:50:32 +05:00
d4a2d4c87b
Also derive NgException from std::exception to print the error message in Python / on the command line.
35 lines
996 B
C++
35 lines
996 B
C++
#ifndef FILE_NGEXCEPTION
|
|
#define FILE_NGEXCEPTION
|
|
|
|
/**************************************************************************/
|
|
/* File: ngexception.hpp */
|
|
/* Author: Joachim Schoeberl */
|
|
/* Date: 16. Jan. 2002 */
|
|
/**************************************************************************/
|
|
|
|
namespace netgen
|
|
{
|
|
|
|
/// Base class for all ng exceptions
|
|
class NgException : public std::exception
|
|
{
|
|
/// verbal description of exception
|
|
string m_what;
|
|
public:
|
|
///
|
|
DLL_HEADER NgException (const string & s);
|
|
///
|
|
DLL_HEADER virtual ~NgException ();
|
|
|
|
/// append string to description
|
|
DLL_HEADER void Append (const string & s);
|
|
// void Append (const char * s);
|
|
|
|
/// verbal description of exception
|
|
const string & What() const { return m_what; }
|
|
virtual const char* what() const noexcept override { return m_what.c_str(); }
|
|
};
|
|
}
|
|
|
|
#endif
|