From 3937edf9c2cf37350736bf835cb9c68cfa4be971 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Thu, 10 Sep 2020 13:07:01 -0400 Subject: [PATCH] - adds getters to the graph service exception for better introspection --- .../graph/http/GraphServiceException.java | 44 ++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/microsoft/graph/http/GraphServiceException.java b/src/main/java/com/microsoft/graph/http/GraphServiceException.java index cff5865b224..550e72c1dcb 100644 --- a/src/main/java/com/microsoft/graph/http/GraphServiceException.java +++ b/src/main/java/com/microsoft/graph/http/GraphServiceException.java @@ -112,7 +112,7 @@ public class GraphServiceException extends ClientException { * The response headers */ private final List responseHeaders; - + /** * Whether to log the full error response */ @@ -175,7 +175,7 @@ public String getMessage() { } /** - * Gets the The HTTP status code + * Gets the HTTP status code * * @return The HTTP status response code */ @@ -183,6 +183,46 @@ public int getResponseCode() { return responseCode; } + /** + * Gets the response headers + * @return the response headers + */ + public List getResponseHeaders() { + return responseHeaders; + } + + /** + * Gets the error returned by the service + * @return the error returned by the service + */ + public GraphErrorResponse getError() { + return error; + } + + /** + * Gets the HTTP method of the request + * @return the HTTP method of the request + */ + public String getMethod() { + return method; + } + + /** + * Gets the URL of the request + * @return the URL of the request + */ + public String getUrl() { + return url; + } + + /** + * Gets the request headers + * @return the request headers + */ + public List getRequestHeaders() { + return requestHeaders; + } + /** * Gets the message for this exception *