Open svncsvr opened 6 years ago
If the ExceptionHandler
is deactivated then it is a bug.
I will have a look into it.
Thanks for reporting it.
Hi @svncsvr , try to set the propery ExceptionHandler.SwallowWebExceptions = false
let me know
Hi Riccardo, I already set it to false.The problem only arises If I store AuthenticatedUser instance with a valid access token in a dictionary for caching purpose and try to use it again (acquired from the cache I am not creating a fresh instance and I revoked the app's access to my twitter account so the token must be invalidated) instead of throwing an exception lets say for timeline calls, it returns null.
Tweetinvi version : 2.1.0
Is there any news on this.I might wanna look into source code and try to figure out what the problem is if there aren't a fix for the this issue.
No news on my side for now, I am currently trying to focus on the Twitter deadline of August 16.
Do you read and write from the dictionary on the same thread?
I think the Exception Handler's settings are stored per-thread, so if reading the user out of the dictionary on another thread, you'd need to set ExceptionHandler.SwallowWebExceptions = false;
again.
I'm having the same problem even when I add ExceptionHandler.SwallowWebExceptions = false;
before every Tweetinvi call it won't throw anything... I'm using the Async classes. Also ExceptionHandler.GetLastException()
is always empty...
UPDATE Never mind https://github.com/linvi/tweetinvi/pull/770 should fix this
This is how I acquire an authenticated user to save a few requests for the sake of speed
I am storing these authenticated users in a dictionary.Today I tried revoking application access to my twitter test account manually on their website.After I revoke application access and try using this authenticated user to get timeline, instead of throwing exception it returns null ( I already turned swallow exceptions switched off and made sure exception handling is actually working.)
Would it be possible to throw exceptions in this case as well or will I have to remove my cache mechanism to catch 401 errors and mark locally stored token expired.