你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

HttpRequestException Class

public class HttpRequestException
extends AzureException

The HttpRequestException that represents an exception thrown when an HTTP request fails.

This exception is typically thrown when the client sends an HTTP request to the Azure service, but the service is unable to process the request.

Constructor Summary

Constructor Description
HttpRequestException(HttpRequest request)

Initializes a new instance of the HttpRequestException class.

HttpRequestException(HttpRequest request, Throwable cause)

Initializes a new instance of the HttpRequestException class.

HttpRequestException(String message, HttpRequest request)

Initializes a new instance of the HttpRequestException class.

HttpRequestException(String message, HttpRequest request, Throwable cause)

Initializes a new instance of the HttpRequestException class.

HttpRequestException(String message, HttpRequest request, Throwable cause, boolean enableSuppression, boolean writableStackTrace)

Initializes a new instance of the HttpRequestException class.

Method Summary

Modifier and Type Method and Description
HttpRequest getRequest()

Gets the HttpRequest being sent when the exception occurred.

Methods inherited from java.lang.Object

Methods inherited from java.lang.Throwable

Constructor Details

HttpRequestException

public HttpRequestException(HttpRequest request)

Initializes a new instance of the HttpRequestException class.

Parameters:

request - The HttpRequest being sent when the exception occurred.

HttpRequestException

public HttpRequestException(HttpRequest request, Throwable cause)

Initializes a new instance of the HttpRequestException class.

Parameters:

request - The HttpRequest being sent when the exception occurred.
cause - The Throwable which caused the creation of this HttpRequestException.

HttpRequestException

public HttpRequestException(String message, HttpRequest request)

Initializes a new instance of the HttpRequestException class.

Parameters:

message - The exception message.
request - the HTTP request sends to the Azure service

HttpRequestException

public HttpRequestException(String message, HttpRequest request, Throwable cause)

Initializes a new instance of the HttpRequestException class.

Parameters:

message - The exception message.
request - The HttpRequest being sent when the exception occurred.
cause - The Throwable which caused the creation of this HttpRequestException.

HttpRequestException

public HttpRequestException(String message, HttpRequest request, Throwable cause, boolean enableSuppression, boolean writableStackTrace)

Initializes a new instance of the HttpRequestException class.

Parameters:

message - The exception message.
request - The HttpRequest being sent when the exception occurred.
cause - The Throwable which caused the creation of this HttpRequestException.
enableSuppression - Whether suppression is enabled or disabled.
writableStackTrace - Whether the exception stack trace will be filled in.

Method Details

getRequest

public HttpRequest getRequest()

Gets the HttpRequest being sent when the exception occurred.

Returns:

The HttpRequest being sent when the exception occurred.

Applies to