Skip to content

Commit 3937edf

Browse files
committed
- adds getters to the graph service exception for better introspection
1 parent 7853d37 commit 3937edf

File tree

1 file changed

+42
-2
lines changed

1 file changed

+42
-2
lines changed

src/main/java/com/microsoft/graph/http/GraphServiceException.java

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public class GraphServiceException extends ClientException {
112112
* The response headers
113113
*/
114114
private final List<String> responseHeaders;
115-
115+
116116
/**
117117
* Whether to log the full error response
118118
*/
@@ -175,14 +175,54 @@ public String getMessage() {
175175
}
176176

177177
/**
178-
* Gets the The HTTP status code
178+
* Gets the HTTP status code
179179
*
180180
* @return The HTTP status response code
181181
*/
182182
public int getResponseCode() {
183183
return responseCode;
184184
}
185185

186+
/**
187+
* Gets the response headers
188+
* @return the response headers
189+
*/
190+
public List<String> getResponseHeaders() {
191+
return responseHeaders;
192+
}
193+
194+
/**
195+
* Gets the error returned by the service
196+
* @return the error returned by the service
197+
*/
198+
public GraphErrorResponse getError() {
199+
return error;
200+
}
201+
202+
/**
203+
* Gets the HTTP method of the request
204+
* @return the HTTP method of the request
205+
*/
206+
public String getMethod() {
207+
return method;
208+
}
209+
210+
/**
211+
* Gets the URL of the request
212+
* @return the URL of the request
213+
*/
214+
public String getUrl() {
215+
return url;
216+
}
217+
218+
/**
219+
* Gets the request headers
220+
* @return the request headers
221+
*/
222+
public List<String> getRequestHeaders() {
223+
return requestHeaders;
224+
}
225+
186226
/**
187227
* Gets the message for this exception
188228
*

0 commit comments

Comments
 (0)