aboutsummaryrefslogtreecommitdiff
path: root/lib/jobs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/jobs')
-rw-r--r--lib/jobs/basejob.cpp14
-rw-r--r--lib/jobs/basejob.h14
2 files changed, 19 insertions, 9 deletions
diff --git a/lib/jobs/basejob.cpp b/lib/jobs/basejob.cpp
index 6984f16f..2a6705b8 100644
--- a/lib/jobs/basejob.cpp
+++ b/lib/jobs/basejob.cpp
@@ -509,12 +509,12 @@ BaseJob::Status BaseJob::status() const
return d->status;
}
-int BaseJob::error() const
+QByteArray BaseJob::rawData() const
{
- return d->status.code;
+ return d->rawResponse;
}
-QString BaseJob::errorCaption() const
+QString BaseJob::statusCaption() const
{
switch (d->status.code)
{
@@ -553,14 +553,14 @@ QString BaseJob::errorCaption() const
}
}
-QString BaseJob::errorString() const
+int BaseJob::error() const
{
- return d->status.message;
+ return d->status.code;
}
-QByteArray BaseJob::errorRawData() const
+QString BaseJob::errorString() const
{
- return d->rawResponse;
+ return d->status.message;
}
QUrl BaseJob::errorUrl() const
diff --git a/lib/jobs/basejob.h b/lib/jobs/basejob.h
index 0d791d3a..c34ba3c3 100644
--- a/lib/jobs/basejob.h
+++ b/lib/jobs/basejob.h
@@ -134,11 +134,21 @@ namespace QMatrixClient
QUrl requestUrl() const;
bool isBackground() const;
+ /** Current status of the job */
Status status() const;
+ /** Short human-friendly message on the job status */
+ QString statusCaption() const;
+ /** Raw response body as received from the server */
+ QByteArray rawData() const;
+
+ /** Error (more generally, status) code
+ * Equivalent to status().code
+ * \sa status
+ */
int error() const;
- QString errorCaption() const;
+ /** Error-specific message, as returned by the server */
virtual QString errorString() const;
- QByteArray errorRawData() const;
+ /** A URL to help/clarify the error, if provided by the server */
QUrl errorUrl() const;
int maxRetries() const;