I have a headless piece of hardware which can be remotely updated.
The hardware does little more than run a python script at boot. I'm trying to improve the robustness of this update system.
If I were to update the hardware with a bugged python script (such as a mis-spelt print
or return
(it happens!) or missing a colon) then the python interpreter would refuse to run it as it parses the whole script first.
On this 'parse' it would return back a syntax error. How can I catch this and perform a different action?