Catch exception during AuthorizeAsync

133 views
Skip to first unread message

Hefin Dsouza

unread,
Dec 6, 2013, 7:37:04 PM12/6/13
to google-api-d...@googlegroups.com
When internet connection is not available this line of code throws an exception which cannot be handled I tried using the TRY Catch block but it does not catch it is there a way to handle this exception?

credentials = Await GoogleWebAuthorizationBroker.AuthorizeAsync(New FileStream("Assets\client_secret.json", FileMode.Open, FileAccess.Read), New String() {AdSenseService.Scope.Adsense}, "user", CancellationToken.None)

This only happens when there is no Internet Connection.

Hefin Dsouza

unread,
Dec 12, 2013, 1:50:00 PM12/12/13
to google-api-d...@googlegroups.com

No one?

Derek Wade

unread,
May 16, 2015, 7:57:13 PM5/16/15
to google-api-d...@googlegroups.com
I would suggest you capture the returned Task rather than await the process. You can then check the status of the Task if it faulted. If it didn't you can then call the Result or call Wait with a timeout.
Reply all
Reply to author
Forward
0 new messages