style(abstractnetwork): remove chain of if else.

Signed-off-by: Camila Ayres <hello@camilasan.com>
This commit is contained in:
Camila Ayres 2025-08-07 22:16:43 +02:00 committed by Matthieu Gallien
parent 800c5d71ff
commit 3003a87c79

View File

@ -303,14 +303,18 @@ QByteArray AbstractNetworkJob::requestId()
QString AbstractNetworkJob::errorString() const
{
if (_timedout) {
return tr("Connection timed out");
} else if (!reply()) {
return tr("Unknown error: network reply was deleted");
} else if (reply()->hasRawHeader("OC-ErrorString")) {
return reply()->rawHeader("OC-ErrorString");
} else {
return networkReplyErrorString(*reply());
return tr("The server took too long to respond. Check your connection and try syncing again. If it still doesnt work, reach out to your server administrator.");
}
if (!reply()) {
return tr("An unexpected error occurred. Please try syncing again or contact contact your server administrator if the issue continues.");
}
if (reply()->hasRawHeader("OC-ErrorString")) {
return reply()->rawHeader("OC-ErrorString");
}
return networkReplyErrorString(*reply());
}
QString AbstractNetworkJob::errorStringParsingBody(QByteArray *body)