Sub / Function Name & Error Handeling

  • Thread starter Thread starter Brian P. Hammer
  • Start date Start date
B

Brian P. Hammer

All - How can I tell / extract the name of the sub or function that is creating an error? I'd like to extract this so I can write an event and include the sub name in the error text without having to go to every error handling statement and adding the sub as a string.

Thanks,
Brian
 
Brian P. Hammer said:
All - How can I tell / extract the name of the sub or function that is
creating an error? I'd like to extract this so I can write an event and
include the sub name in the error text without having to go to every error
handling statement and adding the sub as a string.

'MethodBase.GetCurrentMethod().­Name'.
 
Make use of the TargetSite and Source properties of the exception type to determine the method and the name of the app that caused the exception.

HTH, Metallikanz!
All - How can I tell / extract the name of the sub or function that is creating an error? I'd like to extract this so I can write an event and include the sub name in the error text without having to go to every error handling statement and adding the sub as a string.

Thanks,
Brian
 
Back
Top