Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

New Post: JsonSerializationException on Home Timeline & others

$
0
0
Hi Linvi,
It looks like it's trying to deserialise Rate Limit Exceeded messages as whatever the result would otherwise be (Tweets, Direct messages etc...).

I modified the latest version of TweetInvi so that JsonConvertWrapper.DeserializeObject catches the JsonSerializationException and creates a new Exception that also includes the raw JSON (basically the same as the patch I sent you the last time I had a problem with JSON Deserialization).
With this, the log messages now look like:
2015-08-04 12:57:35 - TwitterRestPoller.Program: Error: Exception whilst fetching User Home Feed. Exception:
JsonDeserializationException:
Tweetinvi.Core.Exceptions.DetailedJsonSerializationException: Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.IEnumerable`1[Tweetinvi.Core.Interfaces.DTO.ITweetDTO]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.
To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.
Path 'errors', line 1, position 10.
   at Tweetinvi.Logic.Wrapper.JsonConvertWrapper.DeserializeObject[T](String json, JsonConverter[] converters) in c:\Users\Josh Keegan\Documents\Visual Studio 2013\Projects\TweetInvi\Development - 0.9.9.x\Tweetinvi.Logic\Wrapper\JsonConvertWrapper.cs:line 30
   at Tweetinvi.Logic.JsonConverters.JsonObjectConverter.DeserializeObject[T](String json, JsonConverter[] converters) in c:\Users\Josh Keegan\Documents\Visual Studio 2013\Projects\TweetInvi\Development - 0.9.9.x\Tweetinvi.Logic\JsonConverters\JsonObjectConverter.cs:line 26
   at Tweetinvi.Credentials.TwitterAccessor.ExecuteGETQuery[T](String query, JsonConverter[] converters) in c:\Users\Josh Keegan\Documents\Visual Studio 2013\Projects\TweetInvi\Development - 0.9.9.x\Tweetinvi.Credentials\TwitterAccessor.cs:line 139
   at Tweetinvi.Controllers.Timeline.TimelineQueryExecutor.GetHomeTimeline(IHomeTimelineParameters timelineParameters) in c:\Users\Josh Keegan\Documents\Visual Studio 2013\Projects\TweetInvi\Development - 0.9.9.x\Tweetinvi.Controllers\Timeline\TimelineQueryExecutor.cs:line 41
   at Tweetinvi.Controllers.Timeline.TimelineController.GetHomeTimeline(IHomeTimelineParameters parameters) in c:\Users\Josh Keegan\Documents\Visual Studio 2013\Projects\TweetInvi\Development - 0.9.9.x\Tweetinvi.Controllers\Timeline\TimelineController.cs:line 47
   at Tweetinvi.Timeline.GetHomeTimeline(IHomeTimelineParameters homeTimelineParameters) in c:\Users\Josh Keegan\Documents\Visual Studio 2013\Projects\TweetInvi\Development - 0.9.9.x\Tweetinvi\Timeline.cs:line 76
   at TwitterRestPoller.Program.fetchUserHomeFeed(TwitterAccount user, Nullable`1 sinceId) in c:\Users\Josh Keegan\Documents\Visual Studio 2013\Projects\CommsManager\TwitterRestPoller\Program.cs:line 621
   at TwitterRestPoller.Program.pollUserHomeFeed(TwitterAccount user) in c:\Users\Josh Keegan\Documents\Visual Studio 2013\Projects\CommsManager\TwitterRestPoller\Program.cs:line 585
Raw JSON:
{"errors":[{"message":"Rate limit exceeded","code":88}]}
Cheers,
Josh

Viewing all articles
Browse latest Browse all 4126

Trending Articles