SaveTool: handle error code 0 (blocked by firewall).

This commit is contained in:
Guillaume Jacquemin 2022-03-31 09:00:57 +02:00
parent 94f6192aa8
commit b909aa85b7

View file

@ -324,8 +324,12 @@ void SaveTool::updateCheckEvent(SDL_Event& event) {
return;
}
if(r.status_code == 0) {
_queue.addToast(Toast::Type::Error, "Seems like the connection was blocked.\nPlease check your firewall's settings.");
}
if(r.status_code != 200) {
_queue.addToast(Toast::Type::Error, Utility::format("The request failed with error code {}: {}", r.status_code, r.reason.c_str()));
_queue.addToast(Toast::Type::Error, Utility::format("The request failed with error code {}:\n{}", r.status_code, r.reason.c_str()));
return;
}