View previous topic :: View next topic |
Author |
Message |
PaulS
Joined: 03 Jul 2013 Posts: 24
|
Posted: Wed Oct 29, 2014 11:45 pm Post subject: Bootstrap error handling question |
|
|
WinForms: A couple of users are seeing the Bootstrap Error dialog, which doesn't show as much error information as my own custom error dialogs. I did some testing and it appears that the bootstrap handles errors with it's own error dialog up until my main form's Load handler is called. Once inside Load my error handling takes over. I am wondering what is happening here. I would like to handle errors in the Main entry point, and in the ctor of the main form. |
|
Back to top |
|
 |
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Thu Oct 30, 2014 4:10 am Post subject: |
|
|
The Bootstraps exception handler will handle any exception that is thrown in your application and not handled, or exceptions that are actual raised in the bootstrap itself. You can of course customize the Bootstrap error handler to display more information if required. To minimize the number of exceptions that might end up propagating out to the bootstrap you should ensure that your application defines a main method (rather than just setting a startup form in VB.NET) and the main method has an exception handler. In addition if you want your application to be able to continue after an exception has occurred then you should consider handling the Application.ThreadException event. See this link for more information:
http://stackoverflow.com/questions/337702/how-to-implement-one-catchem-all-exception-handler-with-resume _________________ Infralution Support |
|
Back to top |
|
 |
PaulS
Joined: 03 Jul 2013 Posts: 24
|
Posted: Thu Oct 30, 2014 3:17 pm Post subject: |
|
|
My mistake. I just had to remove the try-catch in the bootstrap program main (I used your demo code) and my exception handling works normally again. |
|
Back to top |
|
 |
|