Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Classes/TradeQueryRequests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,12 @@ function TradeQueryRequestsClass:FetchLeagues(realm, callback)
end
local json_data = dkjson.decode(response.body)
if not json_data or json_data.error then
errMsg = json_data and json_data.error or "Failed to parse trade leagues JSON"
local apiError = json_data and json_data.error
errMsg = apiError or "Failed to parse trade leagues JSON"
if type(apiError) == "table" then
errMsg = apiError.message or (apiError.code and tostring(apiError.code)) or "Failed to parse trade leagues JSON"
end
return callback({"Standard", "Hardcore"}, errMsg)
end
local leagues = {}
for _, value in pairs(json_data.result) do
Expand Down
Loading