Deepsolver
Public Types | Public Member Functions
Deepsolver::OperationCoreException Class Reference

exception for general operation problems More...

Inheritance diagram for Deepsolver::OperationCoreException:
Deepsolver::AbstractException

List of all members.

Public Types

enum  {
  InvalidInfoFile, InvalidChecksumData, BrokenIndexFile, LimitExceeded,
  InvalidInstalledPkg, InvalidRepoPkg, 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.
std::string getParam () const
 Returns the optional string parameter of the error occurred.
std::string getType () const
 Returns a string with short error type designation.
 OperationCoreException (int code)
 The constructor with error code specification.
 OperationCoreException (int code, const std::string &param)
 The constructor with error code and optional parameter specification.
virtual ~OperationCoreException ()
 The destructor.

Detailed Description

This class is purposed for various general operation problems. These errors can be thrown only by the methods of OperationCore class, covering transaction processing as well as index updating. General error types are a checksum mismatch, invalid content of repo file and so on. Downloading problems have their own exception class name of CurlException.


Constructor & Destructor Documentation

Deepsolver::OperationCoreException::OperationCoreException ( int  code) [inline]
Parameters:
[in]codeThe error code
Deepsolver::OperationCoreException::OperationCoreException ( int  code,
const std::string &  param 
) [inline]
Parameters:
[in]codeThe error code
[in]paramThe optional string parameter

Member Function Documentation

void Deepsolver::OperationCoreException::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".

Parameters:
[in]visitorThe reference to the visitor

Implements Deepsolver::AbstractException.

int Deepsolver::OperationCoreException::getCode ( ) const [inline]
Returns:
The error code
std::string Deepsolver::OperationCoreException::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.

Returns:
A single line error description

Implements Deepsolver::AbstractException.

std::string Deepsolver::OperationCoreException::getParam ( ) const [inline]
Returns:
The optional string parameter of the error
std::string Deepsolver::OperationCoreException::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.

Returns:
A short string with error type designation

Implements Deepsolver::AbstractException.