switch to source editor on error

[?]
Sep 4, 2023, 7:33 AM
IZGZEWFGSMVXXFGMBITHUZUSFAJGWZNBE7LR7PCZ52P2JEO5HAUQC

Dependencies

  • [2] DMS3N5YD undo an ancient hack; be an idiomatic LÖVE app
  • [3] CUFW4EJL reorganize app.lua and its comments
  • [4] 3QNOKBFM beginnings of a test harness
  • [5] DJSIRUMD a more radical attempt at ignoring nil y's
  • [6] AGJXIDOF hardcode some assumptions about how this app uses love
  • [*] AVTNUQYR basic test-enabled framework

Change contents

  • edit in app.lua at line 5
    [3.69]
    [3.69]
    -- * recover from errors (by switching to the source editor)
  • replacement in app.lua at line 28
    [4.440][4.440:481]()
    love.handlers[name](a,b,c,d,e,f)
    [4.440]
    [4.481]
    xpcall(function() love.handlers[name](a,b,c,d,e,f) end, handle_error)
  • replacement in app.lua at line 33
    [2.59][2.59:78]()
    App.update(dt)
    [2.59]
    [2.78]
    xpcall(function() App.update(dt) end, handle_error)
  • replacement in app.lua at line 37
    [4.273][4.273:288]()
    App.draw()
    [4.273]
    [4.288]
    xpcall(App.draw, handle_error)
  • edit in app.lua at line 44
    [8.2551]
    [3.305]
    function handle_error(err)
    Error_message = debug.traceback('Error: ' .. tostring(err), --[[stack frame]]2):gsub('\n[^\n]+$', '')
    print(Error_message)
    if Current_app == 'run' then
    Settings.current_app = 'source'
    love.filesystem.write('config', json.encode(Settings))
    load_file_from_source_or_save_directory('main.lua')
    App.undo_initialize()
    App.run_tests_and_initialize()
    else
    love.event.quit()
    end
    end