Exception

Defines

MAKE_EXCEPTION(class_name)

Create a new type of exception.

Example:

namespace test
{
    MAKE_EXCEPTION(base)
    void throw_base()
    {
        throw test::base("dedicated error");
    }
}

Parameters:
  • class_name – the name of the class

class NaelException : public std::exception
#include <exception.hh>

Pure virtual class to create dedicated exceptions.

Subclassed by bo::consistency, fatal_error, opt::consistency

Public Functions

inline explicit NaelException(const std::string &message)
inline const char *what() const noexcept override
virtual ~NaelException() override = 0

Private Members

std::string _message
class fatal_error : public NaelException
#include <exception.hh>

Dedicated exception for irrecoverable error.

Public Functions

inline fatal_error(const std::string &message)
~fatal_error() = default
namespace io
class access_error : public NaelException

Exception for file access error.

Public Functions

inline access_error(const std::string &message)
~access_error() = default
namespace bo
class consistency : public NaelException
#include <exception.hh>

Dedicated exception for consistency in input data.

Public Functions

inline consistency(const std::string &message)
~consistency() = default
namespace opt
class consistency : public NaelException
#include <exception.hh>

Dedicated exception for consistency during optimization.

Public Functions

inline consistency(const std::string &message)
~consistency() = default
These exceptions are also provided :
  • fatal_error : exception for irrecoverable error

  • bo::consistency : exception for consistency issue in Business Object Model

  • io::access_error : exception for file access error