PublishTweet no exception for "Invalid or expired token"
See original GitHub issueHi,
Follow this code:
ITwitterCredentials credentials = Auth.SetUserCredentials(website.TwitterConsumerKey, website.TwitterConsumerSecret, authorizationKey, authorizationSecret);
ITweet theTweet = await TweetAsync.PublishTweet(message);
ITwitterException ex = ExceptionHandler.GetLastException();
With wrong credential (user has remove its authorization), PublishTweet return null. BUG: ExceptionHandler.GetLastException(); return no exception !!!
But if I don’t use Async:
ITwitterCredentials credentials = Auth.SetUserCredentials(website.TwitterConsumerKey, website.TwitterConsumerSecret, authorizationKey, authorizationSecret);
ITweet theTweet = Tweet.PublishTweet(message);
ITwitterException ex = ExceptionHandler.GetLastException();
With wrong credential (user has remove its authorization), PublishTweet return null. And ex contain ““Unauthorized - Authentication credentials were missing or incorrect.”” The behavior is OK.
Regards
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Twitter API - Reasons for "invalid or expired token"
1. This error occurs when the token you're using is either expired or invalid. Verify that the strings you're using for access token...
Read more >Get an Invalid or Expired Token Error Response
Get an Invalid or Expired Token Error Response. The following error can occur if you have regenerated tokens or revoked access to your...
Read more >Invalid or expired token after few API requests
Dear community, My twitter app (@CancellerBot) encounters the error 89 (“Invalid or expired token.”) regularly now, for no obvious reasons.
Read more >Cannot enable 2FA on ring.com with invalid/expired token ...
After entering the code generated by 1Password on Ring's page, I am getting an "Invalid or expired code." error as shown here.
Read more >Troubleshooting "Invalid Token Provided" Error on ...
The error occurs when the API token linked to the Org2Org application has expired. API tokens have an expiration date and need to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
ok work fine
This issue will be fixed by Tweetinvi 5.0 as it no longer relies on
ThreadStatic
orAsyncContext
.