Public Types | |
enum | { InvalidSectionHeader = 1, EmptySectionName = 2, ParameterWithoutSection = 3, InvalidUnquotedValue = 4, InvalidLineBeginning = 5, InvalidParameterName = 6, InvalidCharAfterEquals = 7, UnexpectedLineEnd = 8 } |
Public Member Functions | |
ConfigFileException (int code, const std::string &fileName, size_t line) | |
The constructor with error code, file name and line number specification. | |
ConfigFileException (int code) | |
The constructor with error code only specification. | |
int | getCode () const |
Returns error code. | |
std::string | getDescr () const |
Returns the string with error description. | |
std::string | getFileName () const |
Returns name of a file with error. | |
size_t | getLine () const |
Returns line number. | |
std::string | getMessage () const |
Returns exception description. | |
void | makeLogReport (int level) const |
Makes report to logging system. | |
virtual | ~ConfigFileException () |
ConfigFileException::ConfigFileException | ( | int | code | ) | [inline] |
[in] | code | The error code for new exception object |
ConfigFileException::ConfigFileException | ( | int | code, | |
const std::string & | fileName, | |||
size_t | line | |||
) | [inline] |
[in] | code | The error code for new exception object |
[in] | fileName | Name of a file with error |
[in] | line | The line number with error (must not be zero) |
virtual ConfigFileException::~ConfigFileException | ( | ) | [inline, virtual] |
The destructor
int ConfigFileException::getCode | ( | ) | const [inline] |
Use this method to get error code of current exception object.
std::string ConfigFileException::getDescr | ( | ) | const [inline] |
This method analyzes current error code and returns a string with corresponding error description.
std::string ConfigFileException::getFileName | ( | ) | const [inline] |
Use this method to get file name being processed.
size_t ConfigFileException::getLine | ( | ) | const [inline] |
This method has assert() to check current object was created through the constructor with line number specification.
std::string ConfigFileException::getMessage | ( | ) | const [inline, virtual] |
This method generates single line description of the error object. returned string can be printed to console or to log as error report.
Implements VoicemanException.
void ConfigFileException::makeLogReport | ( | int | level | ) | const [inline, virtual] |
This function writes to log a report about error object. It may be not exactly the same value as produced by getMessage() method. The level of message must be specified, because the same error can have different levels in different situations. For example, configuration file error is critical error during server startup process due to to requirement have first configuration information, but be just a usual error in configuration reloading, because in this case server can successfully use its previous configuration data.
level | The level of error log report |
Implements VoicemanException.