NetworkRequest onError now uses NetworkResult

This commit is contained in:
fourtf
2019-09-19 19:03:50 +02:00
parent 986694e4bc
commit 758a6bb41c
10 changed files with 60 additions and 72 deletions
+2 -7
View File
@@ -88,10 +88,7 @@ void LogsPopup::getLogviewerLogs(const QString &roomID)
NetworkRequest(url)
.caller(this)
.onError([this](int /*errorCode*/) {
this->getOverrustleLogs();
return true;
})
.onError([this](NetworkResult) { this->getOverrustleLogs(); })
.onSuccess([this, roomID](auto result) -> Outcome {
auto data = result.parseJson();
std::vector<MessagePtr> messages;
@@ -140,7 +137,7 @@ void LogsPopup::getOverrustleLogs()
NetworkRequest(url)
.caller(this)
.onError([this](int /*errorCode*/) {
.onError([this](NetworkResult) {
auto box = new QMessageBox(
QMessageBox::Information, "Error getting logs",
"No logs could be found for channel " + this->channelName_);
@@ -150,8 +147,6 @@ void LogsPopup::getOverrustleLogs()
box->raise();
this->close();
box->exec();
return true;
})
.onSuccess([this](auto result) -> Outcome {
auto data = result.parseJson();