G
Guest
I'm trying to implement a generic exception handling routine that will write
information to a text file at the time the exception occurred. I am using the
Microsoft Application Block for Exception Handling to write to a text file.
This is working great plus I get the call stack which is an added bonus.
What I really want to get is the value of parameters and variables in each
method in the call stack at the time of the exception. I know I can write
code to build a string of all of the current variables and their values and
pass that string to a custom exception handler but this isn't elegant nor
generic. The problem with this is that the code must always be updated as the
method is changed and variables are added or removed. We've done this in some
VB6 code and it's not easy to maintain.
I've found that using Reflection I can get to the CallStack and the
parameters of each method in the call stack but I am not able to get to the
values of those parameters. I am also not able to get to any declared
variables in those methods.
I find it hard to believe that no one else is interested in this type of
exception information so if anyone has any ideas on how to do this or if
anyone has seen or written great exception handling code, please let me know.
Thanks,
Dan
information to a text file at the time the exception occurred. I am using the
Microsoft Application Block for Exception Handling to write to a text file.
This is working great plus I get the call stack which is an added bonus.
What I really want to get is the value of parameters and variables in each
method in the call stack at the time of the exception. I know I can write
code to build a string of all of the current variables and their values and
pass that string to a custom exception handler but this isn't elegant nor
generic. The problem with this is that the code must always be updated as the
method is changed and variables are added or removed. We've done this in some
VB6 code and it's not easy to maintain.
I've found that using Reflection I can get to the CallStack and the
parameters of each method in the call stack but I am not able to get to the
values of those parameters. I am also not able to get to any declared
variables in those methods.
I find it hard to believe that no one else is interested in this type of
exception information so if anyone has any ideas on how to do this or if
anyone has seen or written great exception handling code, please let me know.
Thanks,
Dan