From: Matthieu Gallien Date: Thu, 25 Nov 2021 21:58:12 +0000 (+0100) Subject: use the error message sent by the server for bulk upload X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~18^2~83^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1a9aade28e84ecb8c1ef0d27ce2fb6436cf7ff9b;p=nextcloud-desktop.git use the error message sent by the server for bulk upload Signed-off-by: Matthieu Gallien --- 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,