Skip to content

Commit f5d517c

Browse files
Add missing exception info for HttpClient and SocketsHttpHandler properties (dotnet#11043)
Harmonize the exception docs with the actual implementation for HttpClient and SocketsHttpHandler properties. --------- Co-authored-by: Genevieve Warren <[email protected]>
1 parent 905ec6b commit f5d517c

File tree

2 files changed

+106
-4
lines changed

2 files changed

+106
-4
lines changed

xml/System.Net.Http/HttpClient.xml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,9 @@ The specified `handler` will be disposed of by calling [HttpClient.Dispose](xref
276276
277277
]]></format>
278278
</remarks>
279+
<exception cref="T:System.ArgumentException">The <see cref="T:System.Uri" /> specified is not an absolute URI.</exception>
280+
<exception cref="T:System.InvalidOperationException">The <see cref="T:System.Net.Http.HttpClient" /> instance has already started one or more requests.</exception>
281+
<exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Http.HttpClient" /> instance has already been disposed.</exception>
279282
</Docs>
280283
</Member>
281284
<Member MemberName="CancelPendingRequests">
@@ -508,6 +511,8 @@ The `DefaultRequestVersion` property can be changed as long as the <xref:System.
508511
This property has no effect on any of the <xref:System.Net.Http.HttpClient.Send%2A> or <xref:System.Net.Http.HttpClient.SendAsync%2A> overloads that accept an <xref:System.Net.Http.HttpRequestMessage?displayProperty=nameWithType>.
509512
]]></format>
510513
</remarks>
514+
<exception cref="T:System.InvalidOperationException">The <see cref="T:System.Net.Http.HttpClient" /> instance has already started one or more requests.</exception>
515+
<exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Net.Http.HttpClient" /> instance has already been disposed.</exception>
511516
</Docs>
512517
</Member>
513518
<MemberGroup MemberName="DeleteAsync">
@@ -2349,7 +2354,10 @@ The <paramref name="requestUri" /> is not an absolute URI.
23492354
23502355
]]></format>
23512356
</remarks>
2352-
<exception cref="T:System.ArgumentOutOfRangeException">The size specified is less than or equal to zero.</exception>
2357+
<exception cref="T:System.ArgumentOutOfRangeException">The size specified is less than or equal to zero
2358+
-or-
2359+
2360+
The size specified is greater than the maximum allowed buffer size.</exception>
23532361
<exception cref="T:System.InvalidOperationException">An operation has already been started on the current instance.</exception>
23542362
<exception cref="T:System.ObjectDisposedException">The current instance has been disposed.</exception>
23552363
</Docs>
@@ -3720,7 +3728,11 @@ httpClient.Timeout = TimeSpan.FromMinutes(10);
37203728
37213729
]]></format>
37223730
</remarks>
3723-
<exception cref="T:System.ArgumentOutOfRangeException">The timeout specified is less than or equal to zero and is not <see cref="F:System.Threading.Timeout.InfiniteTimeSpan" />.</exception>
3731+
<exception cref="T:System.ArgumentOutOfRangeException">The timeout specified is less than or equal to zero and is not <see cref="F:System.Threading.Timeout.InfiniteTimeSpan" />
3732+
3733+
-or-
3734+
3735+
The timeout specified is greater than <see cref="F:System.Int32.MaxValue" /> milliseconds.</exception>
37243736
<exception cref="T:System.InvalidOperationException">An operation has already been started on the current instance.</exception>
37253737
<exception cref="T:System.ObjectDisposedException">The current instance has been disposed.</exception>
37263738
</Docs>

0 commit comments

Comments
 (0)