Script errors should not prevent console commands from running
-
Facing a situation I could resolve with a single cpu halt, but can't execute anything due to the error.
-
Trying to do the "right" thing in all the edge cases is sticky. But I think wrapping the main loop execution in a
try
and moving the console commands to afinally
would work for most cases.https://github.com/screeps/engine/blob/master/src/game/game.js#L504
Where this goes wrong is if the console also throws an error, but since console command should be transient the edge case shouldn't be persistent.