Interface IRosterHttpClientExceptionGenerator
Generates appropriate exceptions for request failures.
Namespace: Microsoft.XboxStudios.SQTech.Roster.Client
Assembly: Microsoft.XboxStudios.SQTech.Roster.Client.Common.dll
Syntax
public interface IRosterHttpClientExceptionGenerator
Methods
View SourceCreateClientException(HttpMethod, Uri, HttpRequestException)
Creates an exception for a given failure.
Declaration
RosterClientHttpException CreateClientException(HttpMethod httpMethod, Uri uri, HttpRequestException hrex)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpMethod | httpMethod | The HTTP method used. |
| Uri | uri | The URI of the request. |
| HttpRequestException | hrex | An optional exception thrown by the request. |
Returns
| Type | Description |
|---|---|
| RosterClientHttpException | A RosterClientHttpException that can be thrown by your request client. |
CreateClientExceptionFromResponseAsync(HttpResponseMessage, HttpMethod, Uri, string?)
Creates an exception from a non-success HTTP response.
Declaration
Task<RosterClientHttpException> CreateClientExceptionFromResponseAsync(HttpResponseMessage response, HttpMethod httpMethod, Uri uri, string? requestContent)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpResponseMessage | response | The HTTP response. |
| HttpMethod | httpMethod | The HTTP method used. |
| Uri | uri | The URI of the request. |
| string | requestContent | Optional request content. |
Returns
| Type | Description |
|---|---|
| Task<RosterClientHttpException> | A RosterClientHttpException that can be thrown by your request client. |