mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Increase timeout on FFZ channel emote requests
We might want to send some message upon these sort of errors happening Fix #709
This commit is contained in:
parent
8eba7a0182
commit
56b1fd6913
1 changed files with 20 additions and 1 deletions
|
@ -152,7 +152,7 @@ void FfzEmotes::loadChannel(const QString &channelName,
|
|||
NetworkRequest request("https://api.frankerfacez.com/v1/room/" +
|
||||
channelName);
|
||||
request.setCaller(QThread::currentThread());
|
||||
request.setTimeout(3000);
|
||||
request.setTimeout(20000);
|
||||
|
||||
request.onSuccess([callback = std::move(callback)](auto result) -> Outcome {
|
||||
auto pair = parseChannelEmotes(result.parseJson());
|
||||
|
@ -160,6 +160,25 @@ void FfzEmotes::loadChannel(const QString &channelName,
|
|||
return pair.first;
|
||||
});
|
||||
|
||||
request.onError([channelName](int result) {
|
||||
if (result == 203) {
|
||||
// User does not have any FFZ emotes
|
||||
return true;
|
||||
}
|
||||
|
||||
if (result == -2) {
|
||||
// TODO: Auto retry in case of a timeout, with a delay
|
||||
log("Fetching FFZ emotes for channel {} failed due to timeout",
|
||||
channelName);
|
||||
return true;
|
||||
}
|
||||
|
||||
log("Error fetching FFZ emotes for channel {}, error {}", channelName,
|
||||
result);
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
request.execute();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue