Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 03, 2012 09:50 AM by priya_marwaha
Dec 03, 2012 09:50 AM|LINK
Sometimes, if my REST service takes very long, I get the following exception when invoking HttpClient.SendAsync(blah).Result:
System.AggregateException: One or more errors occurred. ---> System.Threading.Tasks.TaskCanceledException: A task was canceled.
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
Is there a way for me to explicitly check (based on exception type/info/other data) whether the task was canceled due to timeout? I'm not explicitly cancelling the task anywhere in my code, so at least I know for sure that the cancellation is being done
by the framework itself.
[Edit] I've already seen this thread: http://stackoverflow.com/questions/10547895/how-can-i-tell-when-httpclient-has-timed-out