In an application that I am writing, I am logging my errors to SQL Server and if that fails to a HTM file.
I have an error handling class that has a property for ClassModule and Routine. Currently, when an error happens in a Try...Catch block, I have to set these properties and then call the HandleError routine. I would like to use a method similar to the one used by Microsoft here.
How can I get the class module that handles the errors to know what the ClassModule and Routine variables should be if I use this method?
The only thing I can think of is to use the Call Stack and parse it out. This seems kinda ugly. I would think that there is some sort of way to get this information since I am sure that I am not the only one who wants this information to be logged with errors.
PS - Yes I do plan to handle certain errors individually, but for other errors, I just plan to have the Try...Catch block Throw the error again.
Any guidance would be greatly appreciated.
I have an error handling class that has a property for ClassModule and Routine. Currently, when an error happens in a Try...Catch block, I have to set these properties and then call the HandleError routine. I would like to use a method similar to the one used by Microsoft here.
How can I get the class module that handles the errors to know what the ClassModule and Routine variables should be if I use this method?
The only thing I can think of is to use the Call Stack and parse it out. This seems kinda ugly. I would think that there is some sort of way to get this information since I am sure that I am not the only one who wants this information to be logged with errors.
PS - Yes I do plan to handle certain errors individually, but for other errors, I just plan to have the Try...Catch block Throw the error again.
Any guidance would be greatly appreciated.