XX CMake Package
Loading...
Searching...
No Matches
XXRestApiException.h
Go to the documentation of this file.
1#ifndef XXRestApiExceptionH
2#define XXRestApiExceptionH
3
5#include <QException>
6
7#include "XXRestApiResult.h"
8
9#include <QJsonObject>
10
11namespace XX
12{
13 namespace RestApi
14 {
17
18 class XXNETWORK_DECLSPEC StatusException : public QException
19 {
20 public:
21 StatusException(const Result& result, const QUrl sourceUrl);
22 StatusException(int statusCode, const QUrl sourceUrl, const QJsonObject& json = QJsonObject());
23
24 public:
25 operator QString() const;
26
27 public:
28 int getStatusCode() const;
29 const QJsonObject& getContent() const;
30 const QUrl& getSourceUrl() const;
31
32 private:
33 Result result;
34 const QUrl sourceUrl;
35 };
36
37 class XXNETWORK_DECLSPEC UnreachableException : public QException
38 {
39 public:
40 UnreachableException(const QUrl& sourceUrl);
41
42 public:
43 operator QString() const;
44
45 public:
46 const QUrl& getSourceUrl() const;
47
48 private:
49 const QUrl sourceUrl;
50 };
51 } // namespace RestApi
52} // namespace XX
53
54#endif // NOT XXRestApiExceptionH
#define XXNETWORK_DECLSPEC
Definition XXNetworkExportDef.h:11
const QUrl & getSourceUrl() const
StatusException(const Result &result, const QUrl sourceUrl)
const QJsonObject & getContent() const
StatusException(int statusCode, const QUrl sourceUrl, const QJsonObject &json=QJsonObject())
UnreachableException(const QUrl &sourceUrl)
const QUrl & getSourceUrl() const
Definition XXRestApiAsync.h:10
Definition XXPopulatedAbstract.h:11
REST API with json content.
Definition XXRestApiResult.h:27