Deepsolver
Public Types | Public Member Functions
TaskException Class Reference

The class for indication user has asked impossible task. More...

Inheritance diagram for TaskException:
DeepsolverException

List of all members.

Public Types

enum  {
  UnknownPackageName = 0, UnsolvableSat = 1, NoSatSolution = 2, Unmet = 3,
  NoRequestedPackage = 4
}

Public Member Functions

const std::string & getArg () const
 Returns the optional error string argument.
int getCode () const
 Returns the error type code.
std::string getMessage () const
 Returns the single line error description.
std::string getType () const
 Returns the string with error type.
 TaskException (int code, const std::string &arg)
 The constructor with error type and string argument initialization.
 TaskException (int code)
 The constructor with error type initialization.
virtual ~TaskException ()
 The destructor.

Detailed Description

package lists generating work. It should not be confused with OperationException class which is used for system or repository problems occurred in transaction. In most cases TaskException indicates errors caused by invalid user input such as user has asked to install unknown package or he has asked to install incompatible set of packages. This class contains optional string argument for various error types. Its meaning depends on particular error.

See also:
AbstractTaskSolver GeneralSolver OperationException

Constructor & Destructor Documentation

TaskException::TaskException ( int  code,
const std::string &  arg 
) [inline]
Parameters:
[in]codeThe error code
[in]argThe string argument value
TaskException::TaskException ( int  code) [inline]
Parameters:
[in]codeThe error code

Member Function Documentation

const std::string& TaskException::getArg ( ) const [inline]

The purpose of this argument depends on error code. It is optional, so not every of the possible task errors must has non-empty string argument.

Returns:
The string argument of the error occurred
int TaskException::getCode ( ) const [inline]

Use this method to get code of the error occurred.

Returns:
The code of the error occurred
std::string TaskException::getMessage ( ) const [inline, virtual]

This method returns the 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.

Returns:
The single line error description

Implements DeepsolverException.

std::string TaskException::getType ( ) const [inline, virtual]

This method returns the short string with one or two words describing the error type. For example, this method can return values like "system", "rpm" etc. The value returned by this method usually is used for error message construction.

Returns:
The short string with error type description

Implements DeepsolverException.