NetworkRequest onError now uses NetworkResult

This commit is contained in:
fourtf
2019-09-19 19:03:50 +02:00
parent 986694e4bc
commit 758a6bb41c
10 changed files with 60 additions and 72 deletions
+5 -1
View File
@@ -8,7 +8,7 @@ namespace chatterino {
class NetworkResult
{
public:
NetworkResult(const QByteArray &data);
NetworkResult(const QByteArray &data, int status);
/// Parses the result as json and returns the root as an object.
/// Returns empty object if parsing failed.
@@ -19,8 +19,12 @@ public:
/// Parses the result as json and returns the document.
rapidjson::Document parseRapidJson() const;
const QByteArray &getData() const;
int status() const;
static constexpr int timedoutStatus = -2;
private:
int status_;
QByteArray data_;
};