J
Jim Bancroft
Hi all,
I'm writing an exception handler for one of my VB.Net methods and
wondered how best to dynamically put the class and method name in my message
string.
My code looks like this currently:
Catch ex as Exception
Dim ex1 As New Exception("Error encountered in
Class-- MyClass, Method-- MyMethod", ex)
Throw ex1
Obviously, hardcoding the class and method names isn't such a hot
idea. I assume reflection will help pull the right information, however I'm
new to that subject and wondered if someone could help provide a code
snippet for this, or a link to where I can learn more? Thanks!
-Jim
I'm writing an exception handler for one of my VB.Net methods and
wondered how best to dynamically put the class and method name in my message
string.
My code looks like this currently:
Catch ex as Exception
Dim ex1 As New Exception("Error encountered in
Class-- MyClass, Method-- MyMethod", ex)
Throw ex1
Obviously, hardcoding the class and method names isn't such a hot
idea. I assume reflection will help pull the right information, however I'm
new to that subject and wondered if someone could help provide a code
snippet for this, or a link to where I can learn more? Thanks!
-Jim