diff options
Diffstat (limited to 'src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ChunkedEncodingReadStream.cs')
-rw-r--r-- | src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ChunkedEncodingReadStream.cs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ChunkedEncodingReadStream.cs b/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ChunkedEncodingReadStream.cs index fdf7d48e56..d10a2233dc 100644 --- a/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ChunkedEncodingReadStream.cs +++ b/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/ChunkedEncodingReadStream.cs @@ -115,10 +115,21 @@ namespace System.Net.Http } } } +#if MONOTOUCH_WATCH + catch (Exception exc) + { + if (CancellationHelper.ShouldWrapInOperationCanceledException(exc, cancellationToken)) + { + throw CancellationHelper.CreateOperationCanceledException(exc, cancellationToken); + } + throw; + } +#else catch (Exception exc) when (CancellationHelper.ShouldWrapInOperationCanceledException(exc, cancellationToken)) { throw CancellationHelper.CreateOperationCanceledException(exc, cancellationToken); } +#endif finally { ctr.Dispose(); @@ -161,10 +172,21 @@ namespace System.Net.Http await _connection.FillAsync().ConfigureAwait(false); } } +#if MONOTOUCH_WATCH + catch (Exception exc) + { + if (CancellationHelper.ShouldWrapInOperationCanceledException(exc, cancellationToken)) + { + throw CancellationHelper.CreateOperationCanceledException(exc, cancellationToken); + } + throw; + } +#else catch (Exception exc) when (CancellationHelper.ShouldWrapInOperationCanceledException(exc, cancellationToken)) { throw CancellationHelper.CreateOperationCanceledException(exc, cancellationToken); } +#endif finally { ctr.Dispose(); |