dotnet / dotnet/dotnet-api-docs

Exception timing

Abierto
#992 0 comentarios 0 reacciones 0 asignados Ver en GitHub
area-System.Net dotnet-api/prod Pri2 untriaged
Lenguaje dominante
C#
Estrellas
949
Forks
1.7k
Merge medio
2 d 19 h
PR fusionados (30 d)
52

Descripción

It's not clear which exceptions are thrown during the synchronous portion of the call vs. which are applied to the returned task.

For example, ArgumentNullException can be checked for synchronously, so I'd guess that's when it would be thrown; then again, there's nothing stopping the methods from deferring it.

Regarding HttpRequestException, most such exceptions have to be async, but some, such as an immediate check of whether the device is attached to a network, can be done in the sync portion. Does calling code need to be prepared for an HttpRequestException during both the sync and async portions?

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 2d060a3c-fa61-4f7d-771d-9a33c2bb3dd5
* Version Independent ID: 612cd2e0-d2d5-e0f5-6c1d-5ca962a8813d
* Content: [HttpClient.PostAsync Method (System.Net.Http)](https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient.postasync?view=netframework-4.7.2#System_Net_Http_HttpClient_PostAsync_System_Uri_System_Net_Http_HttpContent_System_Threading_CancellationToken_)
* Content Source: [xml/System.Net.Http/HttpClient.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System.Net.Http/HttpClient.xml)
* Product: **dotnet-api**
* GitHub Login: @dotnet-bot
* Microsoft Alias: **dotnetcontent**

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con xml/System.Net.Http/HttpClient.xml y la documentación de la API HttpClient.PostAsync enlazada. Comprueba qué excepciones están documentadas para la llamada síncrona frente a la tarea devuelta y, después, actualiza la documentación de la API para que los llamadores puedan saber cuándo deben gestionar cada tipo de excepción.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
csharp
Área
documentation
Tipo de issue
Documentación
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.