I have a application with similar code (not written by me)
try
{
EnumerateSomeCoolHardwareDevice();
}
catch (Exception ex)
{
}
UPDATE – This is .NET C# & EnumerateSomeCoolHardwareDevice() is using SerialPort?
I know how bad this code is but it works like this for a reason!
My question thou: I can see that it crashes somewhere in the EnumerateSomeCoolHardwareDevice(); but it doesn’t get caught by the Catch (…) – It just crashes with the send report dialog! This also currently only happen in the release build… Is their ANY reason why my exception will NOT be caught by the catch (…)?
My guess is that you’re not getting an Exception in your language/framework but rather
EnumerateSomeCoolHardwareDevice()does weird things that simply cause the OS to kill your process. Remember that hardware details are abstracted by frameworks like Java and .NET, so whenever you do something with hardware directly, you’re probably relying on unmanaged resources … and whatever goes wrong there can kill you, catch or not.