Skip to content

Commit

Permalink
Improved map library error messaging.
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Balthazar committed Dec 23, 2024
1 parent ef235a7 commit 2402df6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/ui/mapLib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ local function getAndApplyLibraryData(self)

if type(mapsData)=='string' then
feedback:push{{0.7, 0, 0.3}, mapsData, '\n'}
feedback:push{{1, 0.6, 0.3}, 'Can\'t browse in read-only mode\n'}
mapsData = nil
libComError = true
return setUIMode(require'ui.menu')
Expand Down
3 changes: 2 additions & 1 deletion src/utils/network.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ end

function network.getMapLibData(address)
local code, body, headers = require'https'.request(address or 'https://theloudproject.org:8081/maps/')
if code~=200 then return ('Communication error: %s: %s'):format(tostring(code), body) end
if code==0 then return 'Map library server gave no response: Code 0' end
if code~=200 then return ('Communication error with map server: %s: %s'):format(tostring(code), body) end
local mapsData = {}
for mapJsonRaw in body:gmatch'%b{}' do
local data = {}
Expand Down

0 comments on commit 2402df6

Please sign in to comment.