mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
print render crash cause to user
This commit is contained in:
parent
ea8f62dea6
commit
219f02b188
@ -90,6 +90,7 @@ local function main()
|
||||
---@class pkt_state
|
||||
pkt_state = {
|
||||
ui_ok = false,
|
||||
ui_error = nil,
|
||||
shutdown = false
|
||||
},
|
||||
|
||||
@ -179,6 +180,10 @@ local function main()
|
||||
parallel.waitForAll(main_thread.p_exec, render_thread.p_exec)
|
||||
|
||||
renderer.close_ui()
|
||||
|
||||
if not pkt_state.ui_ok then
|
||||
println(util.c("App crashed with error: ", pkt_state.ui_error))
|
||||
end
|
||||
else
|
||||
println_ts("UI creation failed")
|
||||
end
|
||||
|
@ -148,8 +148,6 @@ function threads.thread__render(smem)
|
||||
|
||||
local last_update = util.time()
|
||||
|
||||
local ui_message
|
||||
|
||||
-- thread loop
|
||||
while true do
|
||||
-- check for messages in the message queue
|
||||
@ -171,9 +169,9 @@ function threads.thread__render(smem)
|
||||
|
||||
local draw_start = util.time_ms()
|
||||
|
||||
pkt_state.ui_ok, ui_message = pcall(function () nav.load_app(cmd.val) end)
|
||||
pkt_state.ui_ok, pkt_state.ui_error = pcall(function () nav.load_app(cmd.val) end)
|
||||
if not pkt_state.ui_ok then
|
||||
log.fatal(util.c("RENDER: app load failed with error ", ui_message))
|
||||
log.fatal(util.c("RENDER: app load failed with error ", pkt_state.ui_error))
|
||||
else
|
||||
log.debug("RENDER: app loaded in " .. (util.time_ms() - draw_start) .. "ms")
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user