Deepsolver
Public Types | Public Member Functions
TaskException Class Reference

The exception class for indication user has asked an impossible transaction. More...

Inheritance diagram for TaskException:
DeepsolverException

List of all members.

Public Types

enum  {
  UnknownPackageName, UnsolvableSat, NoSatSolution, Unmet,
  NoRequestedPackage
}

Public Member Functions

const std::string & getArg () const
 Returns optional error string argument.
int getCode () const
 Returns an error type code.
std::string getMessage () const
 Returns a single line error description.
std::string getType () const
 Returns a 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 only initialization.
virtual ~TaskException ()
 The destructor.

Detailed Description

This exception class indicates any error occurred during package lists for installation/removing calculation due to incorrect user request. It should not be confused with OperationException class which is used for errors irrelevant to an invalid user command. TaskException covers cases caused by invalid user input such as user has asked to install an unknown package or he has asked to install incompatible set of packages. This class contains optional string argument wich meaning depends on particular a error.

See also:
OperationCore

Constructor & Destructor Documentation

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

Member Function Documentation

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

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:
String argument of the error occurred
int TaskException::getCode ( ) const [inline]

Use this method to get code of an error occurred.

Returns:
Code of the error occurred
std::string TaskException::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.

Returns:
A single line error description

Implements DeepsolverException.

std::string 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", "rpm" etc. A value returned by this method usually is used for error message construction.

Returns:
A short string with error type description

Implements DeepsolverException.