resolve conflicts
Dependencies
- [2]
3BRGOF7Nreturn failing tests with every code change - [3]
XJEVMWTSremove a no-op regex munging on callstacks - [4]
AFZEVZOUresolve conflicts - [5]
3QNOKBFMbeginnings of a test harness - [6]
TBWAE64Aapp is now live, can communicate with driver - [7]
QFURHRTPrename globals to have a single uppercase letter - [8]
CUFW4EJLreorganize app.lua and its comments - [9]
GXE3ESLGabstraction: roll forward/back - [10]
D6T6FIO4unnecessary coercion - [11]
LRDM35CEapp running again - [12]
FFMMA7L2send Test_failures _before_ restoring globals - [13]
T7QIIGQ6attempt at better error recovery - [14]
BSDXVB3Hbackport some doc updates and renames - [15]
BZDYEW4Mdon't also send success on error - [16]
R6MB3UPBMerge text.love - [17]
NLU6BXIRclean up some cruft from error callstacks - [18]
AGJXIDOFhardcode some assumptions about how this app uses love - [19]
45BU7IRVremove a local
Change contents
- replacement in live.lua at line 204
live.send_to_driver('ERROR '..tostring(err))live.send_to_driver('ERROR '..cleaned_up_frame(tostring(err))) - replacement in live.lua at line 377[5.1287]→[3.0:86](∅→∅),[3.86]→[5.976:1026](∅→∅),[5.1395]→[5.976:1026](∅→∅),[5.10619]→[5.976:1026](∅→∅),[5.1026]→[5.1396:1470](∅→∅)
local stack_trace = debug.traceback('Error: ' .. tostring(err), --[[stack frame]]2)live.send_run_time_error_to_driver(stack_trace)Error_message = 'Something is wrong. Sorry!\n\n'..stack_trace..'\n\n'..local callstack = debug.traceback('', --[[stack frame]]2)local cleaned_up_error = 'Error: ' .. cleaned_up_frame(tostring(err))..'\n'..cleaned_up_callstack(callstack)live.send_run_time_error_to_driver(cleaned_up_error)Error_message = 'Something is wrong. Sorry!\n\n'..cleaned_up_error..'\n\n'.. - edit in live.lua at line 392[5.10778]
-- I tend to read code from files myself (say using love.filesystem calls)-- rather than offload that to load().-- Functions compiled in this manner have ugly filenames of the form [string "filename"]-- This function cleans out this cruft from error callstacks.-- It also strips out the numeric prefixes we introduce in filenames.function cleaned_up_callstack(callstack)local frames = {}for frame in string.gmatch(callstack, '[^\n]+\n*') dotable.insert(frames, cleaned_up_frame(frame))end-- the initial "stack traceback:" line was unindented and remains soreturn table.concat(frames, '\n\t')endfunction cleaned_up_frame(frame)local line = frame:gsub('^%s*(.-)\n?$', '%1')local filename, rest = line:match('([^:]*):(.*)')return cleaned_up_filename(filename)..':'..restendfunction cleaned_up_filename(filename)-- pass through frames that don't match this format-- this includes the initial line "stack traceback:"local core_filename = filename:match('^%[string "(.*)"%]$')if core_filename == nil then return filename end-- strip out the numeric prefixes we introduce in filenameslocal _, core_filename2 = core_filename:match('^(%d+)-(.+)')return core_filename2 or core_filenameend - resurrect zombie in app.lua at line 171
-- returning nil continues the loopend-- protect against runtime errorsreturn function()local status, result = xpcall(App.run_frame, live.handle_error)return result - resurrect zombie in app.lua at line 180
end