I’d like to show a form (the form has a box where you type in what you were doing to make the error occur, etc. and a send button to report the error to my website) when an unhandled exception occurs. As it is now, the form shows up but none of the controls draw (they are all white boxes) and then I get the “Yaya.exe has stopped responding blah blah blah”.
Is there any way to keep the form up while an exception is occurring in the main thread? I’ve tried putting the form in it’s own thread and still not helping. The exception I’m testing this with is a button that starts a backgroundworker, I keep pressing it until it throws the exception which starts the form
You can wrap the contents of your main() method in a try/catch block. Show your error reporting form, log what you need to, etc. and then die.
This is a good practice regardless. It really does make the user feel slightly better to be presented with something that acknowledges the problem rather than just crashing. Of course, I say slightly better, crashes suck regardless.