Package com.microsoft.rest
Class RestException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.microsoft.rest.RestException
-
- All Implemented Interfaces:
Serializable
public class RestException extends RuntimeException
Exception thrown for an invalid response with custom error information.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RestException(String message, retrofit2.Response<okhttp3.ResponseBody> response)Initializes a new instance of the RestException class.RestException(String message, retrofit2.Response<okhttp3.ResponseBody> response, Object body)Initializes a new instance of the RestException class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectbody()retrofit2.Response<okhttp3.ResponseBody>response()-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
RestException
public RestException(String message, retrofit2.Response<okhttp3.ResponseBody> response)
Initializes a new instance of the RestException class.- Parameters:
message- the exception message or the response content if a message is not availableresponse- the HTTP response
-
RestException
public RestException(String message, retrofit2.Response<okhttp3.ResponseBody> response, Object body)
Initializes a new instance of the RestException class.- Parameters:
message- the exception message or the response content if a message is not availableresponse- the HTTP responsebody- the deserialized response body
-
-
Method Detail
-
response
public retrofit2.Response<okhttp3.ResponseBody> response()
- Returns:
- information about the associated HTTP response
-
body
public Object body()
- Returns:
- the HTTP response body
-
-