Ok i would like to create an error handler that would pop up anytime there is an error and state the type of error and number if possible. An example i tested was
And it worked fine but i want to know if this can be used to handle any kind of error and what other options are there.Code:Try 'Any Protected Code prcTextFile.StartInfo.FileName = ("C:\Program Files\ErrorHandler\VbNetError.txt ") prcTextFile.Start () If blnFlg = True Then Exit Try Catch 'Error Handling Logic/Code MessageBox.Show ("Unable to locate the desired file") Finally 'Execution Resumes Here MessageBox.Show ("Error Handler Complete") End Try
Edit* To be more clear this is what im hoping to find something for. Lets say your running a program and an error occurs. Instead of giving you the windows message box it catches the error and send it to your error handler along with the Error number and message of the error. Thats what im hoping for and i know its possible im just not 100% sure on how to do it.
I know that declarations have to be used and something like this to show up in the error handler:
"Textbox1(Error.Name & " (" & ErrorMessage.ToString ")")"




Reply With Quote