1
0
mirror of https://github.com/chylex/Nextcloud-Desktop.git synced 2025-04-09 19:15:43 +02:00

use the error message sent by the server for bulk upload

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
Matthieu Gallien 2021-11-25 22:58:12 +01:00
parent 34c4c28879
commit 1a9aade28e
2 changed files with 6 additions and 4 deletions

View File

@ -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,

View File

@ -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,