gpt4 book ai didi

c# - 使用 TweetSharp 加载用户配置文件列表期间发生 StackOverflow 异常

转载 作者:行者123 更新时间:2023-11-30 17:06:45 24 4
gpt4 key购买 nike

我正在使用最新版本的 TweetSharp 来加载用户的个人资料。首先,我使用 ListFollowerIdsFor 方法加载用户的所有关注者。之后,我将所有 ID 分成最多 100 个 ID 的列表。

 var ids = newUsersIds.Skip(i * 100).Take(100).Distinct().ToList();var users = service.ListUserProfilesFor(new ListUserProfilesForOptions { UserId = ids });

And sometimes I get StackoverflowException on this line.Last two lines in call stack:

The thread '<No Name>' (0x17a0) has exited with code 0 (0x0).

A first chance exception of type 'System.Net.WebException' occurred in System.dll

中的递归

    TweetSharp.dll!TweetSharp.JsonSerializer.DeserializeContent(string content, System.Type type) Line 168 + 0x1b bytes C#
TweetSharp.dll!TweetSharp.JsonSerializer.DeserializeSingle(string content, System.Type type) Line 223 + 0x11 bytes C#
TweetSharp.dll!TweetSharp.JsonSerializer.DeserializeJson(string content, System.Type type) Line 41 + 0xe bytes C#

我该如何预防?

最佳答案

问题在于处理 HTTP 500 错误“Twitter 容量过大”。 Tweetsharp 尝试在这种情况下序列化 html 页面。

关于c# - 使用 TweetSharp 加载用户配置文件列表期间发生 StackOverflow 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15219009/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com