I don’t have answer to this question, but seeing the exception thrown I wonder why the GHI .NetMF does seem to throw only “System.Exception(s)” ?
I got the same exception in my USB Host programs.
Could it be possible to have more precise exceptions ? This would also help program to react differently, depending on the type of the exception. What do you think ?
Maybe an GHIElectronics.NETMF.Exception assembly could be provided ?
Exceptions are rare things and shouldn’t cause that much trouble… A more precise exception would be nice, but the process actually is complex and unlikely to change.
But without creating a GHIException assembly, would it be possible to detail a little bit more the exception generated ?
I mean, there are lots of existing System.Exceptions so maybe exceptions like System.ArgumentOutOfRangeException or System.DivideByZeroException (if applicable, of course) could be thrown instead of the generic (and not meaningful) System.Exception with no info on what generated it.
Exceptions like out of range, divide by zero, not implemented…etc. are being used whenever possible. I am not sure why you think we only use system exception?
At first, when I was debugging my tests with USB Host, I only got System.Exception(s). I then thought that I was unlucky but I remembered that I also got the same exceptions in my very first programs for the board.
And now I see another guy getting the same exception in another domain. That’s the reason why I think (thought) you were not throwing “dedicated” exceptions.
Also, Supa’s answer did almost confirm my idea.
If I’m wrong, which I hope, then that’s fine and you can forget my request With apologies from me.
When we have error internal to the system (USB or SD…etc.) then the exception is a “system exception” but when the error is something else then we do raise the appropriate exception.