From 1a9aade28e84ecb8c1ef0d27ce2fb6436cf7ff9b Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Thu, 25 Nov 2021 22:58:12 +0100 Subject: [PATCH] use the error message sent by the server for bulk upload Signed-off-by: Matthieu Gallien --- src/libsync/bulkpropagatorjob.cpp | 7 ++++--- src/libsync/bulkpropagatorjob.h | 3 ++- 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, -- 2.30.2