I am trying to mark a tweet as a favourite, I have the authorization token and am able to view profile details. When I search for tweets I get back list but I am unable to mark any as a favourite, I receive and exception and a message "Value cannot be null. Parameter name: s"
System.ArgumentNullException was unhandled by user code
HResult=-2147467261
Message=Value cannot be null.
Parameter name: s
Source=mscorlib
ParamName=s
StackTrace:
at System.IO.StringReader..ctor(String s)
at Newtonsoft.Json.Linq.JObject.Parse(String json)
at TweetinviLogic.Wrapper.JObjectStaticWrapper.GetJobjectFromJson(String json)
at TweetinviCredentials.TwitterAccessor.ExecutePOSTQuery(String query)
at TweetinviCredentials.TwitterAccessor.TryExecutePOSTQuery(String query, JsonConverter[] converters)
at TweetinviControllers.Tweet.TweetQueryExecutor.FavouriteTweet(ITweetDTO tweet)
at TweetinviControllers.Tweet.TweetController.FavoriteTweet(ITweetDTO tweetDTO)
at TweetinviLogic.Tweet.Favourite()
at TwitterBot.UnitTest1.search() in c:\Users\andrew\Documents\Visual Studio 2013\Projects\TwitterBot\TwitterBot\UnitTest1.cs:line 89
InnerException:
__Update__:
It appears that only some tweet throw the exception over half.
Comments: ** Comment from web user: linvi **
System.ArgumentNullException was unhandled by user code
HResult=-2147467261
Message=Value cannot be null.
Parameter name: s
Source=mscorlib
ParamName=s
StackTrace:
at System.IO.StringReader..ctor(String s)
at Newtonsoft.Json.Linq.JObject.Parse(String json)
at TweetinviLogic.Wrapper.JObjectStaticWrapper.GetJobjectFromJson(String json)
at TweetinviCredentials.TwitterAccessor.ExecutePOSTQuery(String query)
at TweetinviCredentials.TwitterAccessor.TryExecutePOSTQuery(String query, JsonConverter[] converters)
at TweetinviControllers.Tweet.TweetQueryExecutor.FavouriteTweet(ITweetDTO tweet)
at TweetinviControllers.Tweet.TweetController.FavoriteTweet(ITweetDTO tweetDTO)
at TweetinviLogic.Tweet.Favourite()
at TwitterBot.UnitTest1.search() in c:\Users\andrew\Documents\Visual Studio 2013\Projects\TwitterBot\TwitterBot\UnitTest1.cs:line 89
InnerException:
__Update__:
It appears that only some tweet throw the exception over half.
Comments: ** Comment from web user: linvi **
Hi,
I can reproduce your issue. In all cases this issue comes from Twitter informing you that this operation is not authorized.
You can check the ExceptionHandler to verify the received message.
Either case, I will update the code so that this never happens but in the meantime, please just add a Try/Catch around this specific statement.
If you catch it will imply that the operation has been refused by Twitter.
I'll give you some news when the problem is fixed.
Linvi