Skip to content

Commit b2267d0

Browse files
committed
Tidy HttpException and JacksonBodyAdapter
1 parent 34fa253 commit b2267d0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

client/src/main/java/io/avaje/http/client/HttpException.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
public class HttpException extends RuntimeException {
4444

4545
private final int statusCode;
46-
private HttpClientContext context;
46+
private DHttpClientContext context;
4747
private HttpResponse<?> httpResponse;
4848

4949
/**
@@ -70,14 +70,14 @@ public HttpException(int statusCode, Throwable cause) {
7070
this.statusCode = statusCode;
7171
}
7272

73-
HttpException(HttpResponse<?> httpResponse, HttpClientContext context) {
73+
HttpException(HttpResponse<?> httpResponse, DHttpClientContext context) {
7474
super();
7575
this.httpResponse = httpResponse;
7676
this.statusCode = httpResponse.statusCode();
7777
this.context = context;
7878
}
7979

80-
HttpException(HttpClientContext context, HttpResponse<byte[]> httpResponse) {
80+
HttpException(DHttpClientContext context, HttpResponse<byte[]> httpResponse) {
8181
super();
8282
this.httpResponse = httpResponse;
8383
this.statusCode = httpResponse.statusCode();
@@ -93,7 +93,7 @@ public HttpException(int statusCode, Throwable cause) {
9393
@SuppressWarnings("unchecked")
9494
public <T> T bean(Class<T> cls) {
9595
final BodyContent body = context.readContent((HttpResponse<byte[]>) httpResponse);
96-
return context.converters().beanReader(cls).read(body);
96+
return context.readBean(cls, body);
9797
}
9898

9999
/**

client/src/main/java/io/avaje/http/client/JacksonBodyAdapter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ public T readBody(String content) {
9393
}
9494

9595
@Override
96-
public T read(BodyContent s) {
96+
public T read(BodyContent bodyContent) {
9797
try {
98-
return reader.readValue(s.content());
98+
return reader.readValue(bodyContent.content());
9999
} catch (IOException e) {
100100
throw new RuntimeException(e);
101101
}

0 commit comments

Comments
 (0)