Package org.openstack4j.api.exceptions
Class ResponseException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.openstack4j.api.exceptions.OS4JException
-
- org.openstack4j.api.exceptions.ResponseException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AuthenticationException,ClientResponseException,ConnectionException,ContainerNotEmptyException,ServerResponseException
public class ResponseException extends OS4JException
Base Exception for HTTP Errors during Rest Operations- Author:
- Jeremy Unruh
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected StringrequestIdprotected StringrequestInfoprotected intstatus
-
Constructor Summary
Constructors Constructor Description ResponseException(String message, int status)ResponseException(String message, int status, Throwable cause)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intgetStatus()static ResponseExceptionmapException(String message, int status)Deprecated.static ResponseExceptionmapException(String message, int status, Throwable cause)Maps an Exception based on the underlying status codestatic ResponseExceptionmapException(HttpResponse response)static ResponseExceptionmapException(HttpResponse response, String message)voidsetRequestId(String id)voidsetRequestInfo(HttpRequest<?> request)StringtoString()-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
-
-
-
Method Detail
-
mapException
@Deprecated public static ResponseException mapException(String message, int status)
Deprecated.Maps an Exception based on the underlying status code- Parameters:
message- the messagestatus- the status- Returns:
- the response exception
-
mapException
public static ResponseException mapException(String message, int status, Throwable cause)
Maps an Exception based on the underlying status code- Parameters:
message- the messagestatus- the statuscause- the cause- Returns:
- the response exception
-
mapException
public static ResponseException mapException(HttpResponse response)
-
mapException
public static ResponseException mapException(HttpResponse response, String message)
-
getStatus
public int getStatus()
- Returns:
- the raw status code
-
setRequestInfo
public void setRequestInfo(HttpRequest<?> request)
-
setRequestId
public void setRequestId(String id)
-
-