I have a lot of code written from an older winforms project that I was working on. I have recently created a method to log errors (to a database) that occur in a couple try/catch blocks. Is there a way that I can add this functionality to the application overall whenever the application moves to catch ex as exception, or if an exception somehow goes unhandled, instead of adding it to all my try/catch blocks?
My method is created by the dataset designer to insert a row into the "Error Table" within my DB and looks like:
tbladapter.LogError("TRY/CATCH", ex.Message & ";;;; " & ex.InnerException.ToString, My.Application.UserID, Now)
Msgbox("Tell genius he needs to learn how to expect and handle errors!")