Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>2021-11-26 00:58:12 +0300
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>2021-11-26 18:32:08 +0300
commit1a9aade28e84ecb8c1ef0d27ce2fb6436cf7ff9b (patch)
treeba48f8a4ba991b4cfd2b77875becbecbc39b2967 /src/libsync
parent34c4c288794c24bed72db46b150c0b3a67d1ce65 (diff)
use the error message sent by the server for bulk upload
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Diffstat (limited to 'src/libsync')
-rw-r--r--src/libsync/bulkpropagatorjob.cpp7
-rw-r--r--src/libsync/bulkpropagatorjob.h3
2 files changed, 6 insertions, 4 deletions
diff --git a/src/libsync/bulkpropagatorjob.cpp b/src/libsync/bulkpropagatorjob.cpp
index ac66b41b3..06152026a 100644
--- a/src/libsync/bulkpropagatorjob.cpp
+++ b/src/libsync/bulkpropagatorjob.cpp
@@ -320,7 +320,7 @@ void BulkPropagatorJob::slotPutFinishedOneFile(const BulkUploadItem &singleFile,
singleFile._item->_responseTimeStamp = job->responseTimestamp();
singleFile._item->_requestId = job->requestId();
if (singleFile._item->_httpErrorCode != 200) {
- commonErrorHandling(singleFile._item);
+ commonErrorHandling(singleFile._item, fileReply[QStringLiteral("message")].toString());
return;
}
@@ -583,12 +583,13 @@ void BulkPropagatorJob::checkResettingErrors(SyncFileItemPtr item) const
}
}
-void BulkPropagatorJob::commonErrorHandling(SyncFileItemPtr item)
+void BulkPropagatorJob::commonErrorHandling(SyncFileItemPtr item,
+ const QString &errorMessage)
{
// Ensure errors that should eventually reset the chunked upload are tracked.
checkResettingErrors(item);
- abortWithError(item, SyncFileItem::NormalError, tr("Error"));
+ abortWithError(item, SyncFileItem::NormalError, errorMessage);
}
bool BulkPropagatorJob::checkFileStillExists(SyncFileItemPtr item,
diff --git a/src/libsync/bulkpropagatorjob.h b/src/libsync/bulkpropagatorjob.h
index e4846f041..0f7f1a36b 100644
--- a/src/libsync/bulkpropagatorjob.h
+++ b/src/libsync/bulkpropagatorjob.h
@@ -127,7 +127,8 @@ private:
/**
* Error handling functionality that is shared between jobs.
*/
- void commonErrorHandling(SyncFileItemPtr item);
+ void commonErrorHandling(SyncFileItemPtr item,
+ const QString &errorMessage);
bool checkFileStillExists(SyncFileItemPtr item,
const bool finished,