Electron - Exception Handling Behavior?


Searched the forum and couldn’t find a clear answer for this. What happens when an exception occurs in the Electron firmware?

Let’s say I’m currently in the loop() method and hit a “divide by 0” exception. Does it immediately reboot the device or does it just try to run the loop() again on the next pass? Not sure how the SYSTEM_THREAD property impacts this, if at all.

And, would this same behavior apply to the setup() method?


Hi @mike_b

An exception will cause the device to show an SOS code on main RGB LED and then reboot. After a number of reboot tries (three, I think), I believe the device enters safe mode (online but not running user code) so it can be reprogrammed.

Threaded operation certainly impacts this but it is hard to say exactly how with a simple scenario.


Thanks @bko!