-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
Is your feature request related to a problem? Please describe.
When testing certain Polly policies, it can be useful to throw a connection. However it is not really easy to know what the most common exceptions are that can be thrown by the HttpClientHandler.
Describe the solution you'd like
Add a new ExceptionResponse which can easily throw an HttpRequestException.
As far as I can tell, no other exceptions are thrown by the handler and every exception is wrapped into an HttpRequestException.
Describe alternatives you've considered
As an alternative you can use Responses.Configure(_ => throw new HttpRequestExeption()), however this is more verbose and it would be great to get this in the library itself.
Additional context
- Documentation of SendAsync shows the exceptions that are generally thrown.
TaskCancelledExceptionis already useable viaResponses.Timeout() ArgumentNullExceptionandInvalidOperationExceptionare handled by HttpClient itself.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed