Package com.azure.core.exception
Class HttpResponseException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.azure.core.exception.AzureException
-
- com.azure.core.exception.HttpResponseException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ClientAuthenticationException,DecodeException,ResourceExistsException,ResourceModifiedException,ResourceNotFoundException,TooManyRedirectsException
public class HttpResponseException extends AzureException
The exception thrown when an unsuccessful response is received with http status code (e.g. 3XX, 4XX, 5XX) from the service request.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description HttpResponseException(HttpResponse response)Initializes a new instance of the HttpResponseException class.HttpResponseException(HttpResponse response, Throwable cause)Initializes a new instance of the HttpResponseException class.HttpResponseException(String message, HttpResponse response)Initializes a new instance of the HttpResponseException class.HttpResponseException(String message, HttpResponse response, Object value)Initializes a new instance of the HttpResponseException class.HttpResponseException(String message, HttpResponse response, Throwable cause)Initializes a new instance of the HttpResponseException class.HttpResponseException(String message, HttpResponse response, Throwable cause, boolean enableSuppression, boolean writableStackTrace)Initializes a new instance of the HttpResponseException class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpResponsegetResponse()ObjectgetValue()-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
HttpResponseException
public HttpResponseException(HttpResponse response)
Initializes a new instance of the HttpResponseException class.- Parameters:
response- TheHttpResponsereceived that is associated to the exception.
-
HttpResponseException
public HttpResponseException(String message, HttpResponse response)
Initializes a new instance of the HttpResponseException class.- Parameters:
message- The exception message.response- TheHttpResponsereceived that is associated to the exception.
-
HttpResponseException
public HttpResponseException(HttpResponse response, Throwable cause)
Initializes a new instance of the HttpResponseException class.- Parameters:
response- TheHttpResponsereceived that is associated to the exception.cause- TheThrowablewhich caused the creation of this exception.
-
HttpResponseException
public HttpResponseException(String message, HttpResponse response, Object value)
Initializes a new instance of the HttpResponseException class.- Parameters:
message- The exception message.response- TheHttpResponsereceived that is associated to the exception.value- The deserialized response value.
-
HttpResponseException
public HttpResponseException(String message, HttpResponse response, Throwable cause)
Initializes a new instance of the HttpResponseException class.- Parameters:
message- The exception message.response- TheHttpResponsereceived that is associated to the exception.cause- TheThrowablewhich caused the creation of this exception.
-
HttpResponseException
public HttpResponseException(String message, HttpResponse response, Throwable cause, boolean enableSuppression, boolean writableStackTrace)
Initializes a new instance of the HttpResponseException class.- Parameters:
message- The exception message.response- TheHttpResponsereceived that is associated to the exception.cause- TheThrowablewhich caused the creation of this exception.enableSuppression- Whether suppression is enabled or disabled.writableStackTrace- Whether the exception stack trace will be filled in.
-
-
Method Detail
-
getResponse
public HttpResponse getResponse()
- Returns:
- The
HttpResponsereceived that is associated to the exception.
-
getValue
public Object getValue()
- Returns:
- The deserialized HTTP response value.
-
-