net.lua

main 17 lines · 663 bytes Raw
Alex Alex Commit Client Upload Part 2 19/10/2026 00:06
1function translateNetworkError(errcode, connecting, errdesc)
2 local text
3 if errcode == 111 then
4 text = tr('Connection refused, the server might be offline or restarting.\nPlease try again later.')
5 elseif errcode == 110 then
6 text = tr('Connection timed out. Either your network is failing or the server is offline.')
7 elseif errcode == 1 then
8 text = tr('Connection failed, the server address does not exist.')
9 elseif connecting then
10 text = tr('Connection failed.')
11 else
12 text = tr('Your connection has been lost.\nEither your network or the server went down.')
13 end
14 text = text .. ' ' .. tr('(ERROR %d)', errcode)
15 return text
16end
17
Top