Main Site Documentation

Catch all exceptions


#1

Is there a way to catch all exceptions on Spider, Cobra II, Cerb40 …
I have a lot of code. I would like to know for every exception that is raised in my program. Debugging is not a way of course, because I would like to know every exception in real life (it may occur after a few days) and write it to SD or display on screen.
Is there any method I can override or event (Application.OnError) that I can use?


#2

You did not specify whether you were asking about basic MF or Gadgeteer.

There is not a universal catch facility in either.

A watchdog timer is sort of the universal catcher?


#3

An instance of the ApplicationException class is thrown by a user program, not by the common language runtime (CLR). If you are designing an application that needs to create its own exceptions, derive the exceptions from the ApplicationException class.


#4

My applications (Cobra II, Spider) is designed as gadgeteer except small program on Cerb40.
The problem is that my program acts strangely. Is freeze after a few hours/days. I would like to catch all exception. Maybe they will help me to define the problem. The application is to big to remove parts of code, since it could take days to see effect.


#5

Try using this…
http://wiki.tinyclr.com/index.php?title=User:Jay_Jay
Unfortunately there is no such API, i even requested this on netmf codeplex site, you are welcome to vote :wink: https://netmf.codeplex.com/workitem/1630

Cheers,