Deepsolver
|
The exception class for notifications the user task is not solvable. More...
Public Types | |
enum | { UnknownPkg, Contradiction, UnsolvableSat, Unmet, CodeCount } |
Public Member Functions | |
void | accept (ExceptionVisitor &visitor) const |
Calls appropriate visitor method. | |
int | getCode () const |
Returns the error code. | |
std::string | getMessage () const |
Returns a single line error description. | |
const std::string & | getParam () const |
Returns an optional string parameter of the error. | |
std::string | getType () const |
Returns a string with short error type designation. | |
TaskException (int code, const std::string ¶m) | |
The constructor with error type and string parameter. | |
TaskException (int code) | |
The constructor with error code only. | |
virtual | ~TaskException () |
The destructor. |
This exception notifies there is a problem occurred during user task solving. The main its distinction is that problem can be caused only by impossible user request. That means there is no any other implied reasons, neither in package database nor in solver environment.
This exception can be one of the several types designating various invalid situations: an unknown package to install, the same package is considered to install and to remove simultaneously, no packages to satisfy a Require entry etc. An exception instance takes one string parameter with additional information, which purpose depends on exception type. For example, if the problem is an unknown package to install the parameter contains its name and so on.
Deepsolver::TaskException::TaskException | ( | int | code, |
const std::string & | param | ||
) | [inline] |
[in] | code | An error code |
[in] | param | An additional string parameter |
Deepsolver::TaskException::TaskException | ( | int | code | ) | [inline] |
[in] | code | The error code |
void Deepsolver::TaskException::accept | ( | ExceptionVisitor & | visitor | ) | const [inline, virtual] |
This method performs invocation of corresponding visit() method of the visitor, provided by the reference. You should use it each time, when you want to make particular handling action for various exception types, as it suggested by design pattern "visitor".
[in] | visitor | The reference to the visitor |
Implements Deepsolver::AbstractException.
int Deepsolver::TaskException::getCode | ( | ) | const [inline] |
std::string Deepsolver::TaskException::getMessage | ( | ) | const [virtual] |
This method returns a single line string value with error description. Usually it is the value printed to user in the error message. The value should not include error type, since it can be obtained through getType() method.
Implements Deepsolver::AbstractException.
const std::string& Deepsolver::TaskException::getParam | ( | ) | const [inline] |
std::string Deepsolver::TaskException::getType | ( | ) | const [inline, virtual] |
This method returns a short string with one or two words describing the error type. For example, this method can return values like "system", "back-end" etc. A value returned by this method usually is used for error message construction.
Implements Deepsolver::AbstractException.