GraphServiceException Class
- java.
lang. Object - java.
lang. Throwable - java.
lang. Exception - java.
lang. RuntimeException - com.
microsoft. graph. core. ClientException - com.
microsoft. graph. http. GraphServiceException
- com.
- com.
- java.
- java.
- java.
public class GraphServiceException
extends ClientException
An exception from the Graph service
Field Summary
| Modifier and Type | Field and Description |
|---|---|
| static final int |
INTERNAL_SERVER_ERROR
The internal server error threshold defined by the HTTP protocol |
| protected static final int |
MAX_BREVITY_LENGTH
The maximum length for a single line string when trying to be brief |
| protected static final int |
MAX_BYTE_COUNT_BEFORE_TRUNCATION
The number of bytes to display when showing byte array |
| protected static final char |
NEW_LINE
New line delimiter |
| protected static final java.lang.String |
TRUNCATION_MARKER
How truncated values are shown |
Constructor Summary
| Modifier | Constructor | Description |
|---|---|---|
| protected | GraphServiceException(String method, String url, List<String> requestHeaders, String requestBody, int responseCode, String responseMessage, List<String> responseHeaders, GraphErrorResponse error, boolean verbose) |
Create a Graph service exception |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
static
Graph |
createFromResponse(IHttpRequest request, T serializable, ISerializer serializer, Response response, ILogger logger)
Creates a Graph service exception from a given failed HTTP request |
|
static
Graph |
createFromResponse(String url, String method, List<String> requestHeaders, String requestBody, Map<String,String> headers, String responseMessage, int responseCode, GraphErrorResponse error, boolean isVerbose)
Creates a Graph service exception. |
|
Graph |
getError()
Gets the error returned by the service |
| java.lang.String | getMessage() |
| java.lang.String |
getMessage(boolean verbose)
Gets the message for this exception |
| java.lang.String |
getMethod()
Gets the HTTP method of the request |
| java.util.List<java.lang.String> |
getRequestHeaders()
Gets the request headers |
| int |
getResponseCode()
Gets the HTTP status code |
| java.util.List<java.lang.String> |
getResponseHeaders()
Gets the response headers |
| protected static java.util.Map<java.lang.String,java.lang.String> |
getResponseHeadersAsMapStringString(Response response)
Gets the response headers from Ok |
| java.lang.String |
getResponseMessage()
Gets the The HTTP response message |
|
Graph |
getServiceError()
Gets the error message from the Graph service object |
| java.lang.String |
getUrl()
Gets the URL of the request |
Methods inherited from java.lang.Object
Methods inherited from java.lang.Throwable
Field Details
INTERNAL_SERVER_ERROR
public static final int INTERNAL_SERVER_ERROR
The internal server error threshold defined by the HTTP protocol
MAX_BREVITY_LENGTH
protected static final int MAX_BREVITY_LENGTH
The maximum length for a single line string when trying to be brief
MAX_BYTE_COUNT_BEFORE_TRUNCATION
protected static final int MAX_BYTE_COUNT_BEFORE_TRUNCATION
The number of bytes to display when showing byte array
NEW_LINE
protected static final char NEW_LINE
New line delimiter
TRUNCATION_MARKER
protected static final String TRUNCATION_MARKER
How truncated values are shown
Constructor Details
GraphServiceException
protected GraphServiceException(String method, String url, List
Create a Graph service exception
Parameters:
Method Details
createFromResponse
public static GraphServiceException
Creates a Graph service exception from a given failed HTTP request
Parameters:
Returns:
Throws:
createFromResponse
public static GraphServiceException createFromResponse(String url, String method, List
Creates a Graph service exception.
Parameters:
Returns:
getError
public GraphErrorResponse getError()
Gets the error returned by the service
Returns:
getMessage
public String getMessage()
Overrides:
GraphServiceException.getMessage()getMessage
public String getMessage(boolean verbose)
Gets the message for this exception
Parameters:
Returns:
getMethod
public String getMethod()
Gets the HTTP method of the request
Returns:
getRequestHeaders
public List
Gets the request headers
Returns:
getResponseCode
public int getResponseCode()
Gets the HTTP status code
Returns:
getResponseHeaders
public List
Gets the response headers
Returns:
getResponseHeadersAsMapStringString
protected static Map
Gets the response headers from OkHttp Response
Parameters:
Returns:
getResponseMessage
public String getResponseMessage()
Gets the The HTTP response message
Returns:
getServiceError
public GraphError getServiceError()
Gets the error message from the Graph service object
Returns:
getUrl
public String getUrl()
Gets the URL of the request
Returns: