diff --git a/core/synchronizationerror.cpp b/core/synchronizationerror.cpp index cf57d2983..a57a73e66 100644 --- a/core/synchronizationerror.cpp +++ b/core/synchronizationerror.cpp @@ -13,6 +13,24 @@ SynchronizationError::SynchronizationError() = default; SynchronizationError::ErrorType SynchronizationError::errorType( const int httpErrorCode, const QString &errorMessage, const QString &serverErrorCode ) { + //prioritise serverErrorCode parsing before httpErrorCode deduction + if ( serverErrorCode == QStringLiteral( "ProjectsLimitHit" ) ) + { + return ErrorType::ProjectLimitHit; + } + if ( serverErrorCode == QStringLiteral( "StorageLimitHit" ) ) + { + return ErrorType::StorageLimitHit; + } + if ( serverErrorCode == QStringLiteral( "ProjectVersionExists" ) ) + { + return ErrorType::VersionMismatch; + } + if ( serverErrorCode == QStringLiteral( "AnotherUploadRunning" ) ) + { + return ErrorType::AnotherProcessIsRunning; + } + if ( httpErrorCode == 400 ) { // 'Another process is running. Please try later.' @@ -37,26 +55,6 @@ SynchronizationError::ErrorType SynchronizationError::errorType( const int httpE // Project no longer exists / is on different server return ErrorType::ProjectNotFound; } - else if ( httpErrorCode == 409 ) - { - //choose depending on serverErrorCode - if ( serverErrorCode == QStringLiteral( "ProjectsLimitHit" ) ) - { - return ErrorType::ProjectLimitHit; - } - if ( serverErrorCode == QStringLiteral( "StorageLimitHit" ) ) - { - return ErrorType::StorageLimitHit; - } - if ( serverErrorCode == QStringLiteral( "ProjectVersionExists" ) ) - { - return ErrorType::VersionMismatch; - } - if ( serverErrorCode == QStringLiteral( "AnotherUploadRunning" ) ) - { - return ErrorType::AnotherProcessIsRunning; - } - } else if ( httpErrorCode == 429 || httpErrorCode >= 500 ) { // Exceptions in server code or maintenance mode