我正在使用TweetSharp查找用户的关注者。
以下是代码:
public static void FindFollowersForUser(TwitterUserModel twitterUser)
{
try
{
var followers = service.ListFollowersOf(twitterUser.TwitterName, -1);
if (followers == null) return;
while (followers.NextCursor != null)
{
var foundFollowers = service.ListFollowersOf(twitterUser.TwitterName, (long)followers.NextCursor);
if (foundFollowers == null) continue;
Debug.WriteLine("Followers found for: " + twitterUser.TwitterName);
foreach (var follower in foundFollowers)
{
twitterUser.Followers.Add(follower.ScreenName);
}
}
}
catch (WebException e)
{
throw e;
}
}
我尝试使用try/catch来捕获WebException错误并查看其InnerException,但是即使在Visual Studio的输出窗口(View -> Output
)中显示错误消息,catch也从未被触发。
我该如何查看这个导致程序崩溃的错误的内部异常?这是我第一次看到调试器在异常被触发时没有触发catch。