Reflection Calls for Method Names

  • Thread starter Thread starter Joe Keller
  • Start date Start date
J

Joe Keller

Hello,

Whenever an exception is raised in my code, I would like to pass along the
method name where the exception occurred to my custom exception handler so
that I can the origin of the error. Is there a way to use reflection to
determine the name of the currently executing method?

If not, is there any type of stack trace dump that is accessible at the time
an exception is raised that I could pass along to my exception handler that
would give me the information I am looking for?

Thanks!

Joe
 
CF Exceptions do not have StackTrace,
nor do I think you can reflect for the current method name.

i've always followed the pattern of doing this manually with strings:
throw new Exception("ClassName:MethodName - error message", innerExc);

Thanks,
casey
http://www.brains-N-brawn.com
 
Back
Top