<PackageReference Include="System.ClientModel" Version="1.11.0" />

System.ClientModel.ClientResultException

The exception that is thrown when the processing of a client request failed.
public int Status { get; protected set; }

Gets the HTTP status code of the response. Returns. 0 if response was not received.

public ClientResultException(PipelineResponse response, Exception innerException = null)

Initializes a new instance of ClientResultException from a PipelineResponse containing the details of the service's error response. The Message is created from the provided response.

public ClientResultException(string message, PipelineResponse response = null, Exception innerException = null)

Initializes a new instance of ClientResultException with a custom exception message and an optional PipelineResponse. The Message is set to response and if response is provided, it will be returned from calls to this exception instance's GetRawResponse method.

public static Task<ClientResultException> CreateAsync(PipelineResponse response, Exception innerException = null)

Asynchronously create an instance of ClientResultException from the PipelineResponse containing the details of the service's error response.

Gets the PipelineResponse, if any, that led to the exception.