Vivian River
Vivian River

Reputation: 32390

How can I trace where potential exceptions might be thrown from?

We have many questions here about stack traces and analyzing exceptions that have been thrown.

I am using RedGate Reflector to examine the workings of some .net classes. In particular, I am looking at the ConnectionString property of the System.Data.SqlClient.SqlConnection object. Reflector indicates that this property may throw an ArgumentException if an invalid connection string is supplied.

My question is: given that this property may throw this particular exception, how can I analyze the code to find where the exception might be thrown from? The property calls another function to set the value. This function does not throw the ArgumentException directly. I want to know how I can find where this exception might be thrown from.

Upvotes: 1

Views: 112

Answers (2)

Dave Mateer
Dave Mateer

Reputation: 17946

I have never used it before, but I think another Red Gate product, Exception Hunter, is designed to do this.

Upvotes: 0

Jason Haley
Jason Haley

Reputation: 3800

I haven't used it but you might look at Jason Bock's ExceptionFinder for Reflector

Upvotes: 0

Related Questions