Loading...
Searching...
No Matches
error.h
Go to the documentation of this file.
/*
* Copyright 2013-2015 Canonical Ltd.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of version 3 of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#pragma once
#include <QObject>
#include <QProcess>
class QDBusError;
namespace Lomiri {
namespace Transfers {
namespace Errors {
class AuthErrorStruct;
class HttpErrorStruct;
class NetworkErrorStruct;
class ProcessErrorStruct;
class HashErrorStruct;
}
}
namespace DownloadManager {
class ErrorPrivate;
class Error : public QObject {
Q_OBJECT
Q_DECLARE_PRIVATE(Error)
public:
enum Type {
Auth,
DBus,
Http,
Network,
Process,
Hash
};
virtual ~Error();
Type type();
virtual QString errorString();
protected:
Error(Type type, QObject* parent = 0);
private:
ErrorPrivate* d_ptr;
};
class DBusErrorPrivate;
class DBusError : public Error {
Q_OBJECT
Q_DECLARE_PRIVATE(DBusError)
friend class ManagerImpl;
friend class DownloadImpl;
friend class DownloadManagerPCW;
friend class DownloadsListManagerPCW;
friend class MetadataDownloadsListManagerPCW;
friend class DownloadPCW;
friend class GroupManagerPCW;
virtual ~DBusError();
QString message();
QString name();
QString errorString() override;
protected:
DBusError(QDBusError err, QObject* parent = 0);
private:
DBusErrorPrivate* d_ptr;
};
class AuthErrorPrivate;
class AuthError : public Error {
Q_OBJECT
Q_DECLARE_PRIVATE(AuthError)
friend class DownloadImpl;
public:
enum Type {
Server,
Proxy
};
virtual ~AuthError();
Type type();
QString phrase();
QString errorString() override;
protected:
AuthError(Transfers::Errors::AuthErrorStruct err, QObject* parent);
private:
AuthErrorPrivate* d_ptr;
};
class HttpErrorPrivate;
class HttpError : public Error {
Q_OBJECT
Q_DECLARE_PRIVATE(HttpError)
friend class DownloadImpl;
public:
virtual ~HttpError();
int code();
QString phrase();
QString errorString() override;
protected:
HttpError(Transfers::Errors::HttpErrorStruct err, QObject* parent);
private:
HttpErrorPrivate* d_ptr;
};
class NetworkErrorPrivate;
class NetworkError : public Error {
Q_OBJECT
Q_DECLARE_PRIVATE(NetworkError)
friend class DownloadImpl;
public:
enum ErrorCode {
ConnectionRefusedError,
RemoteHostClosedError,
HostNotFoundError,
TimeoutError,
OperationCanceledError,
SslHandshakeFailedError,
TemporaryNetworkFailureError,
NetworkSessionFailedError,
BackgroundRequestNotAllowedError,
ProxyConnectionRefusedError,
ProxyConnectionClosedError,
ProxyNotFoundError,
ProxyTimeoutError,
ProxyAuthenticationRequiredError,
ContentAccessDenied,
ContentOperationNotPermittedError,
ContentNotFoundError,
AuthenticationRequiredError,
ContentReSendError,
ProtocolUnknownError,
ProtocolInvalidOperationError,
UnknownNetworkError,
UnknownProxyError,
UnknownContentError,
ProtocolFailure
};
virtual ~NetworkError();
ErrorCode code();
QString phrase();
QString errorString() override;
protected:
NetworkError(Transfers::Errors::NetworkErrorStruct err, QObject* parent);
private:
NetworkErrorPrivate* d_ptr;
};
class ProcessErrorPrivate;
class ProcessError : public Error {
Q_OBJECT
Q_DECLARE_PRIVATE(ProcessError)
friend class DownloadImpl;
public:
virtual ~ProcessError();
QProcess::ProcessError code();
QString phrase();
int exitCode();
QString standardOut();
QString standardError();
QString errorString() override;
protected:
ProcessError(Transfers::Errors::ProcessErrorStruct err, QObject* parent);
private:
ProcessErrorPrivate* d_ptr;
};
class HashErrorPrivate;
class HashError : public Error {
Q_OBJECT
Q_DECLARE_PRIVATE(HashError)
friend class DownloadImpl;
public:
virtual ~HashError();
QString method();
QString expected();
QString checksum();
QString errorString() override;
protected:
HashError(Transfers::Errors::HashErrorStruct err, QObject* parent);
private:
HashErrorPrivate* d_ptr;
};
} // DownloadManager
} // Lomiri
Lomiri::DownloadManager::AuthError::AuthError
AuthError(Transfers::Errors::AuthErrorStruct err, QObject *parent)
Definition error.cpp:321
Lomiri::DownloadManager::AuthError::Type
Type
Definition error.h:196
Lomiri::DownloadManager::AuthError::Server
@ Server
Definition error.h:197
Lomiri::DownloadManager::AuthError::Proxy
@ Proxy
Definition error.h:198
Lomiri::DownloadManager::AuthError::phrase
QString phrase()
Definition error.cpp:337
Lomiri::DownloadManager::AuthError::errorString
QString errorString() override
Definition error.cpp:343
Lomiri::DownloadManager::AuthError::type
Type type()
Definition error.cpp:331
Lomiri::DownloadManager::AuthError::~AuthError
virtual ~AuthError()
Definition error.cpp:326
Lomiri::DownloadManager::DBusError::DBusError
DBusError(QDBusError err, QObject *parent=0)
Definition error.cpp:294
Lomiri::DownloadManager::Error::Type
Type
Definition error.h:64
Lomiri::DownloadManager::Error::Auth
@ Auth
Definition error.h:65
Lomiri::DownloadManager::Error::Http
@ Http
Definition error.h:67
Lomiri::DownloadManager::Error::Process
@ Process
Definition error.h:69
Lomiri::DownloadManager::Error::DBus
@ DBus
Definition error.h:66
Lomiri::DownloadManager::Error::Network
@ Network
Definition error.h:68
Lomiri::DownloadManager::Error::Hash
@ Hash
Definition error.h:70
Lomiri::DownloadManager::Error::errorString
virtual QString errorString()
Definition error.cpp:289
Lomiri::DownloadManager::Error::~Error
virtual ~Error()
Definition error.cpp:278
Lomiri::DownloadManager::Error::type
Type type()
Definition error.cpp:283
Lomiri::DownloadManager::Error::Error
Error(Type type, QObject *parent=0)
Definition error.cpp:273
Lomiri::DownloadManager::HashError::method
QString method()
Definition error.cpp:459
Lomiri::DownloadManager::HashError::checksum
QString checksum()
Definition error.cpp:471
Lomiri::DownloadManager::HashError::errorString
QString errorString() override
Definition error.cpp:477
Lomiri::DownloadManager::HashError::HashError
HashError(Transfers::Errors::HashErrorStruct err, QObject *parent)
Definition error.cpp:449
Lomiri::DownloadManager::HashError::expected
QString expected()
Definition error.cpp:465
Lomiri::DownloadManager::HashError::~HashError
virtual ~HashError()
Definition error.cpp:454
Lomiri::DownloadManager::HttpError::~HttpError
virtual ~HttpError()
Definition error.cpp:353
Lomiri::DownloadManager::HttpError::code
int code()
Definition error.cpp:358
Lomiri::DownloadManager::HttpError::errorString
QString errorString() override
Definition error.cpp:370
Lomiri::DownloadManager::HttpError::phrase
QString phrase()
Definition error.cpp:364
Lomiri::DownloadManager::HttpError::HttpError
HttpError(Transfers::Errors::HttpErrorStruct err, QObject *parent)
Definition error.cpp:348
Lomiri::DownloadManager::NetworkError::phrase
QString phrase()
Definition error.cpp:392
Lomiri::DownloadManager::NetworkError::NetworkError
NetworkError(Transfers::Errors::NetworkErrorStruct err, QObject *parent)
Definition error.cpp:375
Lomiri::DownloadManager::NetworkError::code
ErrorCode code()
Definition error.cpp:386
Lomiri::DownloadManager::NetworkError::ErrorCode
ErrorCode
Definition error.h:323
Lomiri::DownloadManager::NetworkError::ProtocolInvalidOperationError
@ ProtocolInvalidOperationError
Definition error.h:344
Lomiri::DownloadManager::NetworkError::ProxyTimeoutError
@ ProxyTimeoutError
Definition error.h:336
Lomiri::DownloadManager::NetworkError::AuthenticationRequiredError
@ AuthenticationRequiredError
Definition error.h:341
Lomiri::DownloadManager::NetworkError::UnknownProxyError
@ UnknownProxyError
Definition error.h:346
Lomiri::DownloadManager::NetworkError::ProxyConnectionRefusedError
@ ProxyConnectionRefusedError
Definition error.h:333
Lomiri::DownloadManager::NetworkError::ProxyNotFoundError
@ ProxyNotFoundError
Definition error.h:335
Lomiri::DownloadManager::NetworkError::ContentOperationNotPermittedError
@ ContentOperationNotPermittedError
Definition error.h:339
Lomiri::DownloadManager::NetworkError::BackgroundRequestNotAllowedError
@ BackgroundRequestNotAllowedError
Definition error.h:332
Lomiri::DownloadManager::NetworkError::ProtocolUnknownError
@ ProtocolUnknownError
Definition error.h:343
Lomiri::DownloadManager::NetworkError::SslHandshakeFailedError
@ SslHandshakeFailedError
Definition error.h:329
Lomiri::DownloadManager::NetworkError::UnknownNetworkError
@ UnknownNetworkError
Definition error.h:345
Lomiri::DownloadManager::NetworkError::NetworkSessionFailedError
@ NetworkSessionFailedError
Definition error.h:331
Lomiri::DownloadManager::NetworkError::ContentNotFoundError
@ ContentNotFoundError
Definition error.h:340
Lomiri::DownloadManager::NetworkError::ProxyConnectionClosedError
@ ProxyConnectionClosedError
Definition error.h:334
Lomiri::DownloadManager::NetworkError::OperationCanceledError
@ OperationCanceledError
Definition error.h:328
Lomiri::DownloadManager::NetworkError::HostNotFoundError
@ HostNotFoundError
Definition error.h:326
Lomiri::DownloadManager::NetworkError::UnknownContentError
@ UnknownContentError
Definition error.h:347
Lomiri::DownloadManager::NetworkError::TimeoutError
@ TimeoutError
Definition error.h:327
Lomiri::DownloadManager::NetworkError::ProxyAuthenticationRequiredError
@ ProxyAuthenticationRequiredError
Definition error.h:337
Lomiri::DownloadManager::NetworkError::TemporaryNetworkFailureError
@ TemporaryNetworkFailureError
Definition error.h:330
Lomiri::DownloadManager::NetworkError::ContentReSendError
@ ContentReSendError
Definition error.h:342
Lomiri::DownloadManager::NetworkError::ContentAccessDenied
@ ContentAccessDenied
Definition error.h:338
Lomiri::DownloadManager::NetworkError::RemoteHostClosedError
@ RemoteHostClosedError
Definition error.h:325
Lomiri::DownloadManager::NetworkError::ConnectionRefusedError
@ ConnectionRefusedError
Definition error.h:324
Lomiri::DownloadManager::NetworkError::ProtocolFailure
@ ProtocolFailure
Definition error.h:348
Lomiri::DownloadManager::NetworkError::errorString
QString errorString() override
Definition error.cpp:398
Lomiri::DownloadManager::NetworkError::~NetworkError
virtual ~NetworkError()
Definition error.cpp:381
Lomiri::DownloadManager::ProcessError::errorString
QString errorString() override
Definition error.cpp:444
Lomiri::DownloadManager::ProcessError::phrase
QString phrase()
Definition error.cpp:414
Lomiri::DownloadManager::ProcessError::standardError
QString standardError()
Definition error.cpp:438
Lomiri::DownloadManager::ProcessError::exitCode
int exitCode()
Definition error.cpp:426
Lomiri::DownloadManager::ProcessError::code
QProcess::ProcessError code()
Definition error.cpp:420
Lomiri::DownloadManager::ProcessError::standardOut
QString standardOut()
Definition error.cpp:432
Lomiri::DownloadManager::ProcessError::~ProcessError
virtual ~ProcessError()
Definition error.cpp:409
Lomiri::DownloadManager::ProcessError::ProcessError
ProcessError(Transfers::Errors::ProcessErrorStruct err, QObject *parent)
Definition error.cpp:403
QObject
Lomiri::DownloadManager
Definition download.h:28
Lomiri::Transfers::Errors
Definition error.h:30
Lomiri::Transfers
Definition error.h:28
Lomiri
Definition download.h:26