feat(debug): log Lua errors and document NX crash triage

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Andrew Quenehen
2026-08-01 04:33:14 -03:00
parent 4ea24a0a6f
commit b7ee191b6c
5 changed files with 73 additions and 1 deletions
+14
View File
@@ -12,6 +12,20 @@ local editorMode = os.getenv("POKEPORT_EDITOR") == "1" or POKEPORT_EDITOR_MODE =
local SwitchDiagnostics = require("src.debug.SwitchDiagnostics")
-- Lua errors: persist a redacted trace in the save dir and surface a hint.
do
local defaultErrorHandler = love.errorhandler
function love.errorhandler(msg)
local hint = SwitchDiagnostics.logLuaError(msg)
if hint and type(msg) == "string" then
msg = msg .. "\n\n" .. hint
end
if defaultErrorHandler then
return defaultErrorHandler(msg)
end
end
end
local Game, EditorApp, Importer, TouchEditor
local autopilot -- optional scripted-input dev tool (tests/autopilot.lua)