attempt at better error recovery
[?]
Apr 20, 2023, 7:30 AM
T7QIIGQ6YYTTYCVHVEAZSUQ3O4LYBHGPFL4K6D5TA4BA7PND4EJQCDependencies
- [2]
JNVN64RGstop cranking CPU on error - [3]
45BU7IRVremove a local - [4]
QMSYY47GMerge text0 - [5]
KWIIU3KRdocument available modes - [6]
KVHUFUFVreorg - [7]
JOPVPUSAediting source code from within the app - [8]
TBWAE64Aapp is now live, can communicate with driver - [9]
BSDXVB3Hbackport some doc updates and renames - [10]
XGHCLIKBMerge lines.love - [11]
ZNLTRNNKhighlight another global - [12]
LNUHQOGHstart passing in Editor_state explicitly - [13]
RT6EV6OPdelegate update events to drawings - [14]
D6T6FIO4unnecessary coercion - [15]
2RWR3GM4another missed rename - [16]
OLX2RRDIMerge text0 - [17]
LXFHXL2NMerge text.love - [18]
PJ5PQAQErecord support for multiple versions - [19]
Z4XRNDTRfind text - [20]
5FW7YOFThighlight selection while dragging - [21]
UH4YWHW5button framework is at the app level - [22]
TXDMRA5Jbugfix: alt-tab shouldn't emit keypress events - [23]
LRDM35CEapp running again - [24]
ORKN6EOBMerge lines.love - [25]
KKMFQDR4editing source code from within the app - [26]
JCSLDGAHbeginnings of support for multiple shapes - [27]
K464QQR4more defensive resize handling - [28]
AVTNUQYRbasic test-enabled framework - [29]
AVLAYODPmuch simpler - [30]
2L5MEZV3experiment: new edit namespace - [31]
SDRXK4X5move - [32]
PP2IIHL6stop putting button state in a global - [33]
OTIBCAUJlove2d scaffold - [34]
APX2PY6Gstop tracking wallclock time - [35]
3QQZ7W4Ebring couple more globals back to the app level - [36]
VP5KC4XZMerge lines.love - [37]
IM6GSGVZfix some arg names - [38]
WZZGVKSGa few more renames - [39]
J2SVGR2Eexperiment: blinking cursor - [40]
2CTN2IEFMerge lines.love - [41]
BYG5CEMVsupport for naming points - [42]
6VXO3ZL3just keep the cursor visible after any input events - [43]
36Z442IVback to commit 8123959e52f without code editing - [44]
CYGNFOA5Merge text0
Change contents
- replacement in main.lua at line 16
-- available modes: run, version_checkMode = 'version_check'-- available modes: run, errorMode = 'run'Error_message = nilError_count = 0-- we'll reuse error mode on load for an initial version check - replacement in main.lua at line 24
if array.find(Supported_versions, Version) thenMode = 'run'if array.find(Supported_versions, Version) == nil thenMode = 'error'Error_message = ("This app doesn't support version %s; please use version %s. Press any key to try it with this version anyway."):format(Version, Supported_versions[1])print(Error_message)-- continue initializing everything; hopefully we won't have errors during initialization - replacement in main.lua at line 148
if Mode == 'version_check' thenlove.graphics.setColor(1,1,0)love.graphics.rectangle('fill', 30,30, 400,400)love.graphics.setColor(0,0,0)love.graphics.printf(("This app doesn't support version %s; please use version %s. Press any key to try it with this version anyway."):format(Version, Supported_versions[1]), 40,40, 400)if Mode == 'error' thenlove.graphics.setColor(0,0,1)love.graphics.rectangle('fill', 0,0, App.screen.width, App.screen.height)love.graphics.setColor(1,1,1)love.graphics.printf(Error_message, 40,40, 600) - replacement in main.lua at line 159
if Mode == 'version_check' then return endif Mode == 'error' then return end - edit in main.lua at line 166
-- listen for commands in both 'error' and 'run' modes - replacement in main.lua at line 168
if on.update then on.update(dt) endif Mode == 'run' thenif on.update then on.update(dt) endend - replacement in main.lua at line 174
if Mode == 'version_check' then return endif Mode == 'error' then return end - replacement in main.lua at line 180
if Mode == 'version_check' then return endif Mode == 'error' then return end - replacement in main.lua at line 186
if Mode == 'version_check' then return endif Mode == 'error' then return end - replacement in main.lua at line 192
if Mode == 'version_check' then return endif Mode == 'error' then return end - replacement in main.lua at line 207
if Mode == 'version_check' then return endif Mode == 'error' thenif chord == 'C-c' thenlove.system.setClipboardText(Error_message)endreturnend - replacement in main.lua at line 222
if Mode == 'version_check' then return endif Mode == 'error' then return end - replacement in main.lua at line 232
if Mode == 'version_check' thenif Mode == 'error' then - replacement in live.lua at line 299[6.9968]→[6.9968:10233](∅→∅),[6.10233]→[3.9:115](∅→∅),[6.105]→[6.10341:10619](∅→∅),[3.115]→[6.10341:10619](∅→∅),[6.10341]→[6.10341:10619](∅→∅)
-- draw a pause indicator on screenlove.graphics.setColor(1,0,0)love.graphics.rectangle('fill', 10,10, 3,10)love.graphics.rectangle('fill', 16,10, 3,10)love.graphics.present()-- print stack trace here just in case we ran the app through a terminallocal stack_trace = debug.traceback('Error: '..tostring(err), --[[stack frame]]2):gsub('\n[^\n]+$', '')print(stack_trace)print('Look in the driver for options to investigate further.')print("(You probably can't close the app window at this point. If you don't have the driver set up, you might need to force-quit.)")-- send stack trace to driver and wait for a responseMode = 'error'local stack_trace = debug.traceback('Error: ' .. tostring(err), --[[stack frame]]2):gsub('\n[^\n]+$', '') - replacement in live.lua at line 302[6.659]→[6.10654:10675](∅→∅),[6.1026]→[6.10654:10675](∅→∅),[6.10654]→[6.10654:10675](∅→∅),[6.10675]→[6.1027:1064](∅→∅),[6.1064]→[2.9:37](∅→∅),[2.37]→[6.10700:10752](∅→∅),[6.1064]→[6.10700:10752](∅→∅),[6.10700]→[6.10700:10752](∅→∅)
local bufrepeatbuf = live.receive_from_driver()love.timer.sleep(0.001)until bufif buf == 'QUIT' thenreturn trueError_message = 'Something is wrong. Sorry!\n\n'..stack_trace..'\n\n'.."(Note: function names above don't include outer tables. So functions like on.draw might show up as just 'draw', etc.)\n\n"..'Options:\n'..'- press "ctrl+c" (without the quotes) to copy this message to your clipboard to send to me: ak@akkartik.com\n'..'- press any other key to retry, see if things start working again\n'..'- run driver.love to try to fix it yourself. As you do, feel free to ask me questions: ak@akkartik.com\n'Error_count = Error_count+1if Error_count > 1 thenError_message = Error_message..('\n\nThis is error #%d in this session; things will probably not improve in this session. Please copy the message and send it to me: ak@akkartik.com.'):format(Error_count) - replacement in live.lua at line 312
live.run(buf)print(Error_message)