Deepsolver
Public Member Functions
Deepsolver::CurlException Class Reference

The exception class for libcurl errors. More...

Inheritance diagram for Deepsolver::CurlException:
Deepsolver::AbstractException

List of all members.

Public Member Functions

void accept (ExceptionVisitor &visitor) const
 Calls appropriate visitor method.
 CurlException (int code, const std::string &url, const std::string &descr)
 The constructor.
int getCode () const
 Returns the error code.
std::string getDescr () const
 Returns the error description.
std::string getMessage () const
 Returns a single line error description.
std::string getType () const
 Returns a string with short error type designation.
std::string getUrl () const
 Returns the URL caused the error.
virtual ~CurlException ()
 The destructor.

Detailed Description

This class is used for notifications about the errors occurred during files fetching. It instances contain error code, URL of the resource, caused the error, and short single-line description. For download operations libcurl is used and, hence, this exception is basically purposed to be a wrapper for libcurl failures.


Constructor & Destructor Documentation

Deepsolver::CurlException::CurlException ( int  code,
const std::string &  url,
const std::string &  descr 
) [inline]
Parameters:
[in]codeThe error code
[in]urlA The URL caused a problem
[in]descrThe error description

Member Function Documentation

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

std::string Deepsolver::CurlException::getUrl ( ) const [inline]
Returns:
The URL caused the error