mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
on server errors, treat account as offline
Signed-off-by: Tayou <git@tayou.org>
This commit is contained in:
parent
803115cfde
commit
0a3adb7912
5 changed files with 18 additions and 4 deletions
|
|
@ -40,4 +40,18 @@ inline bool isApplicationError(QNetworkReply::NetworkError x)
|
|||
QNetworkReply::UnknownContentError };
|
||||
return errors.contains(x);
|
||||
}
|
||||
|
||||
// 500 class errors, see https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/500
|
||||
// microsoft may send these error codes when services (auth) are down.
|
||||
// We treat this as a reason to launch in offline mode.
|
||||
inline bool isServerError(QNetworkReply::NetworkError x)
|
||||
{
|
||||
static QSet<QNetworkReply::NetworkError> errors = { QNetworkReply::InternalServerError,
|
||||
QNetworkReply::OperationNotImplementedError,
|
||||
QNetworkReply::ServiceUnavailableError, // 503 | seen in logs in 2026
|
||||
//QNetworkReply::GatewayTimeoutError, // 504 | seen in logs in 2024
|
||||
// Qt doesn't have it mapped. Unknown covers it
|
||||
QNetworkReply::UnknownServerError };
|
||||
return errors.contains(x);
|
||||
}
|
||||
} // namespace Net
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue