1 package com.atlassian.httpclient.api;
2
3 import com.atlassian.httpclient.api.factory.HttpClientOptions;
4
5 /**
6 * Thrown to indicate that a response was dropped because it contained an entity that was larger than the
7 * {@link HttpClientOptions#getMaxEntitySize() configured maximum size}.
8 * <p>
9 * Contains the {@link #getResponse() response} with the response headers, status and first
10 * {@link HttpClientOptions#getMaxCacheEntries() maxEntrySize} bytes of the response body.
11 *
12 * @since 0.23.5
13 */
14 public class ResponseTooLargeException extends RuntimeException {
15
16 static final long serialVersionUID = 1L;
17
18 private final Response response;
19
20 public ResponseTooLargeException(Response response, String message) {
21 super(message);
22 this.response = response;
23 }
24
25 public Response getResponse() {
26 return response;
27 }
28 }