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

New Post: TwitterExceptionTracker

$
0
0
Hi,

I'm trying to implement some robust error handling in my application, and reading through the old docs - https://onedrive.live.com/view.aspx?resid=A575E231BFCAB42D!44520&app=OneNote&wdo=2&authkey=!AHR55vnsqTkUK6s

.. I've added the Tools project back into the TweetInvi dev solution and trying to get it to compile. It all goes well until the TwitterExceptionTracker, this specific method:
 public virtual TwitterException ActionFailed(object action, WebException wex)
        {
            var twitterException = new TwitterException(wex);
           TwitterExceptions.Add(new Tuple<object, TwitterException>(action, twitterException));
            
            return twitterException;
        }
The problem is that TwitterException has a constructor of (IWebExceptionInfoExtractor, WebException, string) but it is only being passed the WebException wex.

Any suggestions or thoughts on what I can do? I was aiming at wrapping everything in code as suggested in the documentation using the ITwitterContext..
ITwitterContext context = new TwitterContext();

List<IUser> followers;
if (!context.TryInvokeAction(() => u.Followers, out followers)
{
    // handle error
}
Thanks in advance,
James

Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>