Improve network error messages (#4704)
This commit is contained in:
@@ -386,23 +386,17 @@ void SeventvEmotes::loadChannelEmotes(
|
||||
makeSystemMessage(CHANNEL_HAS_NO_EMOTES));
|
||||
}
|
||||
}
|
||||
else if (result.status() == NetworkResult::timedoutStatus)
|
||||
{
|
||||
// TODO: Auto retry in case of a timeout, with a delay
|
||||
qCWarning(chatterinoSeventv)
|
||||
<< "Fetching 7TV emotes for channel" << channelId
|
||||
<< "failed due to timeout";
|
||||
shared->addMessage(makeSystemMessage(
|
||||
"Failed to fetch 7TV channel emotes. (timed out)"));
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: Auto retry in case of a timeout, with a delay
|
||||
auto errorString = result.formatError();
|
||||
qCWarning(chatterinoSeventv)
|
||||
<< "Error fetching 7TV emotes for channel" << channelId
|
||||
<< ", error" << result.status();
|
||||
shared->addMessage(
|
||||
makeSystemMessage("Failed to fetch 7TV channel "
|
||||
"emotes. (unknown error)"));
|
||||
<< ", error" << errorString;
|
||||
shared->addMessage(makeSystemMessage(
|
||||
QStringLiteral("Failed to fetch 7TV channel "
|
||||
"emotes. (Error: %1)")
|
||||
.arg(errorString)));
|
||||
}
|
||||
})
|
||||
.execute();
|
||||
@@ -502,14 +496,7 @@ void SeventvEmotes::getEmoteSet(
|
||||
})
|
||||
.onError([emoteSetId, callback = std::move(errorCallback)](
|
||||
const NetworkResult &result) {
|
||||
if (result.status() == NetworkResult::timedoutStatus)
|
||||
{
|
||||
callback("timed out");
|
||||
}
|
||||
else
|
||||
{
|
||||
callback(QString("status: %1").arg(result.status()));
|
||||
}
|
||||
callback(result.formatError());
|
||||
})
|
||||
.execute();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user