Can a photon support exception handling


So I have trawled the forum and there is little or no mention of exception handling.

If I add a try {} catch {} to my code I just get told to use -fexceptions, others have suggested it is not available ???.

So - if that is true - what is the recommended way of handling potential failures on a photon…

Sorry if this is a basic question - my recent background is C# - which is big on exception handling ;-).

NB I prefer to use CLI and/or Dev for compiling…



1 Like

I’m curious too. Please let us know if you find out.


I also am interested in this. I want to use the Catch or Doctest testing libraries. In order to get these libraries to work fexceptions needs to be able to be turned on. I don’t have plans on including fexceptions in actual firmware builds but I’d like to be able to build my code with fexceptions turned on so I can at least run the testing library. How can I accomplish this with at least the cloud-ide?

Be nice if someone addressed this as I do see other related threads: