Forum Post: AW: How to catch errors that occur during System.Windows.Forms.Application:Run

  • Thread starter Thread starter Mike Fechner
  • Start date Start date
Status
Not open for further replies.
M

Mike Fechner

Guest
Hi Carl, errors raised during the execution of the Application:Run () like a runtime error in the constructor of that Form (or code executed from there) or problems finding Assemblies during the loading of the initial Form will be handled by the CATCH block on the WAIT-FOR will already be terminated. In your sample this is everything happening directly related to the instantiation and the execution of the Show method for the MainMenu form. Then you are in the event loop handling. Everything else from there is a response to user interaction and executed from event handlers. Progress does not allow you to implement a default error handler. This is something worth an Idea – if there is not one already. That’s why we do suggest to always have a default CATCH block at the end of every Event handler method. Because that’s typically the end of the user interaction and when something went wrong that can’t be handled otherwise, we at least want to inform the user in a more beautiful message than the Progress default behavior. Typically other code that is invoked from Event handlers will only have a CATCH block when there is something reasonable we can do to handle an error (workaround, alternative behavior). Mike

Continue reading...
 
Status
Not open for further replies.
Back
Top