Reflection Calls for Method Names

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
 
C

casey chesnut

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top