@@ -56,7 +56,23 @@ inline SyncFileItem::Status classifyError(QNetworkReply::NetworkError nerror,
56
56
return SyncFileItem::FatalError;
57
57
}
58
58
59
- if (httpCode == 503 ) {
59
+ switch (httpCode) {
60
+ case 423 :
61
+ // "Locked"
62
+ // Should be temporary.
63
+ Q_FALLTHROUGH ();
64
+ case 502 :
65
+ // "Bad Gateway"
66
+ // Should be temporary.
67
+ if (anotherSyncNeeded != nullptr ) {
68
+ *anotherSyncNeeded = true ;
69
+ }
70
+ Q_FALLTHROUGH ();
71
+ case 412 :
72
+ // "Precondition Failed"
73
+ // Happens when the e-tag has changed
74
+ return SyncFileItem::SoftError;
75
+ case 503 : {
60
76
// When the server is in maintenance mode, we want to exit the sync immediatly
61
77
// so that we do not flood the server with many requests
62
78
// BUG: This relies on a translated string and is thus unreliable.
@@ -67,22 +83,7 @@ inline SyncFileItem::Status classifyError(QNetworkReply::NetworkError nerror,
67
83
&& !errorBody.contains (" Storage is temporarily not available" );
68
84
return probablyMaintenance ? SyncFileItem::FatalError : SyncFileItem::NormalError;
69
85
}
70
-
71
- if (httpCode == 412 ) {
72
- // "Precondition Failed"
73
- // Happens when the e-tag has changed
74
- return SyncFileItem::SoftError;
75
- }
76
-
77
- if (httpCode == 423 ) {
78
- // "Locked"
79
- // Should be temporary.
80
- if (anotherSyncNeeded) {
81
- *anotherSyncNeeded = true ;
82
- }
83
- return SyncFileItem::SoftError;
84
86
}
85
-
86
87
return SyncFileItem::NormalError;
87
88
}
88
89
}
0 commit comments