1 package com.atlassian.sal.api.net;
2
3 /**
4 * Thrown by {@link Request#execute()} to indicate that the request was unsuccessful
5 * based on the response's status code.
6 * <p>
7 * For other Request methods that take a response handler, this exception is not thrown
8 * since it is up to the handler to determine whether a response was an error.
9 *
10 * @since 2.7.0
11 */
12 public class ResponseStatusException extends ResponseException {
13 private final Response response;
14
15 public ResponseStatusException(String message, Response response) {
16 super(message);
17 this.response = response;
18 }
19
20 /**
21 * Returns the actual response, allowing further inspection of the status code
22 * and error message.
23 */
24 public Response getResponse() {
25 return response;
26 }
27 }