QEverCloud 6.1.0
Unofficial Evernote Cloud API for Qt
Loading...
Searching...
No Matches
Exceptions.h
Go to the documentation of this file.
1
8
9#ifndef QEVERCLOUD_EXCEPTIONS_H
10#define QEVERCLOUD_EXCEPTIONS_H
11
12#include "EverCloudException.h"
13#include "Export.h"
14#include "Optional.h"
16#include "generated/Types.h"
17
18#include <QNetworkReply>
19#include <QObject>
20#include <QString>
21
22namespace qevercloud {
23
25
30{
31public:
33 NetworkException(QNetworkReply::NetworkError error);
34 NetworkException(QNetworkReply::NetworkError error, QString message);
35 virtual ~NetworkException() noexcept override;
36
37 bool operator==(const NetworkException & other) const;
38 bool operator!=(const NetworkException & other) const;
39
40 QNetworkReply::NetworkError type() const;
41
42 const char * what() const noexcept override;
43
44 virtual EverCloudExceptionDataPtr exceptionData() const override;
45
46protected:
47 QNetworkReply::NetworkError m_type;
48};
49
55{
56 Q_OBJECT
57 Q_DISABLE_COPY(NetworkExceptionData)
58public:
59 explicit NetworkExceptionData(QString error, QNetworkReply::NetworkError type);
60 virtual void throwException() const override;
61
62protected:
63 QNetworkReply::NetworkError m_type;
64};
65
67
73{
74public:
86
87 friend QEVERCLOUD_EXPORT QTextStream & operator<<(
88 QTextStream & strm, const Type type);
89
92 ThriftException(Type type, QString message);
93 virtual ~ThriftException() noexcept override;
94
95 bool operator==(const ThriftException & other) const;
96 bool operator!=(const ThriftException & other) const;
97
98 Type type() const;
99
100 const char * what() const noexcept override;
101
102 virtual EverCloudExceptionDataPtr exceptionData() const override;
103
104protected:
106};
107
113{
114 Q_OBJECT
115 Q_DISABLE_COPY(ThriftExceptionData)
116public:
117 explicit ThriftExceptionData(QString error, ThriftException::Type type);
118 virtual void throwException() const override;
119
120protected:
122};
123
125
131{
132 Q_OBJECT
133 Q_DISABLE_COPY(EDAMUserExceptionData)
134public:
136 QString error, EDAMErrorCode errorCode, Optional<QString> parameter);
137
138 virtual void throwException() const override;
139
140protected:
143};
144
146
152{
153 Q_OBJECT
154 Q_DISABLE_COPY(EDAMSystemExceptionData)
155public:
157 QString err, EDAMErrorCode errorCode, Optional<QString> message,
158 Optional<qint32> rateLimitDuration);
159
160 virtual void throwException() const override;
161
162protected:
166};
167
169
175{
176 Q_OBJECT
177 Q_DISABLE_COPY(EDAMNotFoundExceptionData)
178public:
180 QString error, Optional<QString> identifier, Optional<QString> key);
181
182 virtual void throwException() const override;
183
184protected:
187};
188
190
197{
198 Q_OBJECT
200public:
202 QList<Contact> contacts, Optional<QString> parameter,
203 Optional<QList<EDAMInvalidContactReason> > reasons);
204
205 virtual void throwException() const override;
206
207protected:
208 QList<Contact> m_contacts;
211};
212
214
224
226
233{
234 Q_OBJECT
236public:
238 QString error, EDAMErrorCode errorCode, Optional<QString> message,
239 Optional<qint32> rateLimitDuration);
240
241 virtual void throwException() const override;
242};
243
245
254
256
263{
264 Q_OBJECT
266public:
268 QString error, EDAMErrorCode errorCode, Optional<QString> message,
269 Optional<qint32> rateLimitDuration);
270
271 virtual void throwException() const override;
272};
273
274} // namespace qevercloud
275
276#endif // QEVERCLOUD_EXCEPTIONS_H
#define QEVERCLOUD_EXPORT
Definition Export.h:19
EDAMInvalidContactsExceptionData(QList< Contact > contacts, Optional< QString > parameter, Optional< QList< EDAMInvalidContactReason > > reasons)
Optional< QString > m_parameter
Definition Exceptions.h:209
QList< Contact > m_contacts
Definition Exceptions.h:208
virtual void throwException() const override
Optional< QList< EDAMInvalidContactReason > > m_reasons
Definition Exceptions.h:210
Optional< QString > m_key
Definition Exceptions.h:186
Optional< QString > m_identifier
Definition Exceptions.h:185
virtual void throwException() const override
EDAMNotFoundExceptionData(QString error, Optional< QString > identifier, Optional< QString > key)
virtual void throwException() const override
EDAMSystemExceptionAuthExpiredData(QString error, EDAMErrorCode errorCode, Optional< QString > message, Optional< qint32 > rateLimitDuration)
virtual EverCloudExceptionDataPtr exceptionData() const override
Optional< QString > m_message
Definition Exceptions.h:164
Optional< qint32 > m_rateLimitDuration
Definition Exceptions.h:165
EDAMErrorCode m_errorCode
Definition Exceptions.h:163
EDAMSystemExceptionData(QString err, EDAMErrorCode errorCode, Optional< QString > message, Optional< qint32 > rateLimitDuration)
virtual void throwException() const override
EDAMSystemExceptionRateLimitReachedData(QString error, EDAMErrorCode errorCode, Optional< QString > message, Optional< qint32 > rateLimitDuration)
virtual EverCloudExceptionDataPtr exceptionData() const override
Optional< QString > m_parameter
Definition Exceptions.h:142
virtual void throwException() const override
EDAMErrorCode m_errorCode
Definition Exceptions.h:141
EDAMUserExceptionData(QString error, EDAMErrorCode errorCode, Optional< QString > parameter)
virtual void throwException() const override
NetworkExceptionData(QString error, QNetworkReply::NetworkError type)
QNetworkReply::NetworkError m_type
Definition Exceptions.h:63
const char * what() const noexcept override
NetworkException(QNetworkReply::NetworkError error)
QNetworkReply::NetworkError m_type
Definition Exceptions.h:47
virtual ~NetworkException() noexcept override
virtual EverCloudExceptionDataPtr exceptionData() const override
QNetworkReply::NetworkError type() const
NetworkException(QNetworkReply::NetworkError error, QString message)
Definition Optional.h:44
ThriftException::Type m_type
Definition Exceptions.h:121
ThriftExceptionData(QString error, ThriftException::Type type)
virtual void throwException() const override
const char * what() const noexcept override
virtual ~ThriftException() noexcept override
Type m_type
Definition Exceptions.h:105
virtual EverCloudExceptionDataPtr exceptionData() const override
ThriftException(Type type, QString message)
friend QEVERCLOUD_EXPORT QTextStream & operator<<(QTextStream &strm, const Type type)
Type
Definition Exceptions.h:75
@ UNKNOWN_METHOD
Definition Exceptions.h:77
@ PROTOCOL_ERROR
Definition Exceptions.h:83
@ BAD_SEQUENCE_ID
Definition Exceptions.h:80
@ MISSING_RESULT
Definition Exceptions.h:81
@ UNKNOWN
Definition Exceptions.h:76
@ WRONG_METHOD_NAME
Definition Exceptions.h:79
@ INVALID_MESSAGE_TYPE
Definition Exceptions.h:78
@ INTERNAL_ERROR
Definition Exceptions.h:82
@ INVALID_DATA
Definition Exceptions.h:84
Definition AsyncResult.h:21
std::shared_ptr< EverCloudExceptionData > EverCloudExceptionDataPtr
Definition EverCloudException.h:149
EDAMErrorCode
Definition EDAMErrorCode.h:113