Seth Spearman
Seth Spearman

Reputation: 6780

How do you get the fully qualified method name when an exception happens

I have a global HandledExceptionHandler. In the catch part of my try catch block I would like to pass the fully qualifed method name where the exception occurred. How do you do that? Can it be done without reflection. HEre is an example of what I am looking for...

Public Sub MySub
   Try
      'some error happens

   Catch
      HandledException (ERROR_LOCATION, SOME_OTHER_ARGUMENT)
   End Try


End Sub

How do I get the ERROR_LOCATION in this case?

Seth

Upvotes: 0

Views: 1193

Answers (1)

Colin Mackay
Colin Mackay

Reputation: 19175

If you have the exception object you can see use the TargetSite property to obtain the information about where the exception was thrown.

Upvotes: 5

Related Questions