<PackageReference Include="Azure.Core" Version="1.48.0" />

RequestFailedException

An exception thrown when service request fails.
public string ErrorCode { get; }

Gets the service specific error code if available. Please refer to the client documentation for the list of supported error codes.

public int Status { get; }

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

public RequestFailedException(string message)

Initializes a new instance of the RequestFailedException class with a specified error message.

public RequestFailedException(string message, Exception innerException)

Initializes a new instance of the RequestFailedException class with a specified error message, HTTP status code and a reference to the inner exception that is the cause of this exception.

public RequestFailedException(int status, string message)

Initializes a new instance of the RequestFailedException class with a specified error message and HTTP status code.

public RequestFailedException(int status, string message, Exception innerException)

Initializes a new instance of the RequestFailedException class with a specified error message and a reference to the inner exception that is the cause of this exception.

public RequestFailedException(int status, string message, string errorCode, Exception innerException)

Initializes a new instance of the RequestFailedException class with a specified error message, HTTP status code, error code, and a reference to the inner exception that is the cause of this exception.

Initializes a new instance of the RequestFailedException class with an error message, HTTP status code, and error code obtained from the specified response.

public RequestFailedException(Response response, Exception innerException)

Initializes a new instance of the RequestFailedException class with an error message, HTTP status code, and error code obtained from the specified response.

public RequestFailedException(Response response, Exception innerException, RequestFailedDetailsParser detailsParser)

Initializes a new instance of the RequestFailedException class with an error message, HTTP status code, and error code obtained from the specified response.

Initializes a new instance of the Exception class with serialized data.

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