locked
Error handling in timer callback functions RRS feed

  • Question

  • I use a System.Threading.Timer object (VB.NET 2003) to call my object's execution method every second.  It all works fine until there is an error and no matter how many try/catch blocks surround the offending code, once an error is generated, the execution routine is then constantly in some error state and never recovers (even though the source of the error is gone).  There is obviously something I'm missing about what happens when an error occurs on a separate thread - any insight how to handle errors on a separate thread correctly?

    Thanks

     

    Dave Taylor

     

    Tuesday, September 19, 2006 5:23 PM

All replies

  • There are a number of problems that could be occurring here.  Can you provide more detail as to what errors continue to happen after the first?  Also can you post some of the code, mainly the error handling routine and timer callback.
    Tuesday, September 19, 2006 6:53 PM
    Moderator