You need to handle within the lambda, like this:
var _client = new HttpClient( /* some setthngs */ );
_client.GetAsync(someUrl, cancellationToken).ContinueWith(gettingTask => {
try {
cancellationToken.ThrowIfCancellationRequested();
SomeStuffToDO();
}
catch (...) { ... }
finaly { ... }
}, TaskScheduler.FromCurrentSynchronizationContext());
}, TaskScheduler.FromCurrentSynchronizationContext());
But _client.GetAsync(someUrl, cancellationToken)
might also throw cancellation exception, so you need to wrap that call (or where its containing method is awaited) with a try-catch.