Kea  2.1.7-git
isc::ConfigError Class Reference

An exception that is thrown if an error occurs while configuring any server. More...

#include <dhcp_config_error.h>

+ Inheritance diagram for isc::ConfigError:

Public Member Functions

 ConfigError (const char *file, size_t line, const char *what)
 constructor More...
 
- Public Member Functions inherited from isc::Exception
 Exception (const char *file, size_t line, const char *what)
 Constructor for a given type for exceptions with file name and file line number. More...
 
 Exception (const char *file, size_t line, const std::string &what)
 Constructor for a given type for exceptions with file name and file line number. More...
 
virtual ~Exception () throw ()
 The destructor. More...
 
virtual const char * what () const throw ()
 Returns a C-style character string of the cause of the exception. More...
 
virtual const char * what (bool verbose) const throw ()
 Returns a C-style character string of the cause of exception. More...
 
const std::string & getMessage () const
 Gets a string describing the cause of the exception. More...
 
const char * getFile () const
 Gets the file name where the exception was thrown. More...
 
size_t getLine () const
 Gets the line number of the file where the exception was thrown. More...
 

Detailed Description

An exception that is thrown if an error occurs while configuring any server.

By convention when this exception is thrown there is a position between parentheses so the code style should be like this:

try { ... } catch (const ConfigError&) { throw; } catch (const std::exception& ex) { isc_throw(ConfigError, "message" << ex.what() << " (" << getPosition(what) << ")"); }

Todo:

: move this header into simple_parser.h

: create an isc_throw like macro to add the position more easily.

Todo:
: replace all references to DhcpConfigError with ConfigError, then remove DhcpConfigError.

Definition at line 43 of file dhcp_config_error.h.

Constructor & Destructor Documentation

◆ ConfigError()

isc::ConfigError::ConfigError ( const char *  file,
size_t  line,
const char *  what 
)
inline

constructor

Parameters
filename of the file, where exception occurred
lineline of the file, where exception occurred
whattext description of the issue that caused exception

Definition at line 51 of file dhcp_config_error.h.


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