MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / onRefreshError

Method onRefreshError

libraries/katabasis/src/DeviceFlow.cpp:427–458  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425}
426
427void DeviceFlow::onRefreshError(QNetworkReply::NetworkError error, QNetworkReply *refreshReply) {
428 QString errorString = "No Reply";
429 if(refreshReply) {
430 timedReplies_.remove(refreshReply);
431 errorString = refreshReply->errorString();
432 }
433
434 switch (error)
435 {
436 // used for invalid credentials and similar errors. Fall through.
437 case QNetworkReply::AuthenticationRequiredError:
438 case QNetworkReply::ContentAccessDenied:
439 case QNetworkReply::ContentOperationNotPermittedError:
440 case QNetworkReply::ProtocolInvalidOperationError:
441 updateActivity(Activity::FailedHard);
442 break;
443 case QNetworkReply::ContentGoneError: {
444 updateActivity(Activity::FailedGone);
445 break;
446 }
447 case QNetworkReply::TimeoutError:
448 case QNetworkReply::OperationCanceledError:
449 case QNetworkReply::SslHandshakeFailedError:
450 default:
451 updateActivity(Activity::FailedSoft);
452 return;
453 }
454 if(refreshReply) {
455 refreshReply->deleteLater();
456 }
457 qDebug() << "DeviceFlow::onRefreshFinished: Error" << (int)error << " - " << errorString;
458}
459
460}

Callers

nothing calls this directly

Calls 1

removeMethod · 0.45

Tested by

no test coverage detected