Runtime Error Handling While Running Scripts

I’ve seen runtime error conditions while running scripts from the IDE where the script stops and pops a message on the PC. For instance, memory errors when calling img.find_blobs on an image that’s too big with too many blobs. How are such errors handled when a device is deployed and running the script off of the SD card or SPI flash? Does it also just stop? Are there any ways we can make it reset or restart the firmware instead of just stopping? Thanks!

…I’m thinking that one fix might be to enable a watchdog timer in firmware before launching a script, and have the script feed the dog so that everything can restart in the event of a Python runtime error.

You can just catch the exception and handle it, or reset in the handler if you want.