Deepsolver
|
The exception for system call errors. More...
Public Member Functions | |
int | getCode () const |
Returns an error code. | |
std::string | getComment () const |
Returns developer error comment. | |
std::string | getDescr () const |
TA error description from the operating system. | |
std::string | getMessage () const |
Returns a single line error description. | |
std::string | getType () const |
Returns a type of an error. | |
SystemException () | |
The default constructor. | |
SystemException (const std::string &comment) | |
The constructor with automatic errno analyzing with developer comment. | |
SystemException (int code) | |
The constructor with error code specification. | |
SystemException (int code, const std::string &comment) | |
The constructor with error code and comment specification. | |
virtual | ~SystemException () |
The destructor. |
This class is used for indication of errors caused by various system calls problems. It automatically analyzes value of system errno variable and can construct informative error description with text provided by operating system. An error message consists of two parts: the short string provided by developer with any information he wants and the string given by a operating system. Developer can save in string, for example, a name of failed system call with its arguments.
Deepsolver::SystemException::SystemException | ( | ) | [inline] |
This constructor implies automatic errno analyzing but without developer string, so the getMessage() method will return only a single line description provided by operating system.
Deepsolver::SystemException::SystemException | ( | const std::string & | comment | ) | [inline] |
This constructor allows developer to give short comment of the error and automatically add string from operating system got through errno variable.
[in] | comment | A developer error comment |
Deepsolver::SystemException::SystemException | ( | int | code | ) | [inline] |
Using this constructor tdeveloper can provide error code by himself without any additional comment. The operating system will be requested for error description using provided error code. The developer must give the value usually got through errno variable.
[in] | code | An error code |
Deepsolver::SystemException::SystemException | ( | int | code, |
const std::string & | comment | ||
) | [inline] |
With this constructor developer can provide an error code to request description from operating system and any short comment he wants. The value of error code must be the value usually taken through errno variable.
[in] | code | An error code |
[in] | comment | Developer error additional information |
int Deepsolver::SystemException::getCode | ( | ) | const [inline] |
This method returns the errno value got at exception throwing.
std::string Deepsolver::SystemException::getComment | ( | ) | const [inline] |
This method returns an error comment provided by developer.
std::string Deepsolver::SystemException::getDescr | ( | ) | const [inline] |
This method returns the error description from an operating system got by an errno value with strerror[] array.
std::string Deepsolver::SystemException::getMessage | ( | ) | const [inline, virtual] |
This method returns a single line string value with error description. Usually it is the value printed to user in error message. The value may not include error type since it can be obtained with getType() method.
Implements Deepsolver::DeepsolverException.
std::string Deepsolver::SystemException::getType | ( | ) | const [inline, virtual] |
This method always returns the "system" string. This string is used in error message construction and allows to distinguish the system errors from any other types of exceptions.
Implements Deepsolver::DeepsolverException.