Save loaded models when application crashes
Issue #316
new
Unfortunately it can happen that TouchCORE crashes. To limit the frustration of the user, we should detect the crash and save the current opened model(s) in a specific place and show a message to the user.
Often, the application crashes when model changes are made and the view updates, where something goes wrong. So I imagine the following:
- The crash is detected (we might be able to do this in
RamApp.draw()
which is called repeatedly and inside the called methodrunApplication
any uncaught exception is "caught"). So we can put the call tosuper.draw()
within a try-catch block. - Because the crash most likely happened during the exception of commands, undo the latest command
- Save the model (or perhaps all models/the complete concern in a specific directory). Here we need to make sure that the complete model can be loaded.
- Show error message to the user.
If we could prevent the application to crash completely that would be even better.