Handle when server listing is unavailable

This is a bad place to display a huge error because it is a repeating
query. And also this is the first thing people see when opening the app
for the first time and it is a bad impression.
This commit is contained in:
Maze 2022-01-15 01:35:56 +01:00
parent 08c6509b17
commit bf76510e8b

View File

@ -553,7 +553,13 @@ class Backend:
)
api_list = "https://publiclist.anchel.nl/publiclist.json"
try:
response = await session.get(api_list)
except:
await session.close()
print("Unable to fetch", api_list)
return
coros = []
for server in (await response.json()):