We just merged a new API adding an HttpRequestError property to HttpRequestException.
public HttpRequestException(string? message, Exception? inner = null, HttpStatusCode? statusCode = null, HttpRequestError? httpRequestError = null);
public HttpRequestError? HttpRequestError { get; }
There is controversy over HttpRequestError, in particular that it's a Nullable<HttpRequestError> when HttpRequestError.Unknown also exists. There are then two different ways to communicate that a meaningful HttpRequestError value could not be provided.
I propose the above be changed to instead be:
public HttpRequestException(HttpRequestError httpRequestError, string? message = null, Exception? inner = null, HttpStatusCode? statusCode = null);
public HttpRequestError HttpRequestError { get; }
- HttpRequestError parameter to the ctor is moved to be first
- message is given a nullable default value
- HttpRequestError property is made non-nullable
We just merged a new API adding an
HttpRequestErrorproperty toHttpRequestException.There is controversy over HttpRequestError, in particular that it's a
Nullable<HttpRequestError>when HttpRequestError.Unknown also exists. There are then two different ways to communicate that a meaningful HttpRequestError value could not be provided.I propose the above be changed to instead be: