Skip to content

Commit 5da5ea8

Browse files
committed
Client HttpException, make all fields final
1 parent 4449296 commit 5da5ea8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public class HttpException extends RuntimeException {
4444

4545
private final int statusCode;
4646
private final boolean responseAsBytes;
47-
private DHttpClientContext context;
48-
private HttpResponse<?> httpResponse;
47+
private final DHttpClientContext context;
48+
private final HttpResponse<?> httpResponse;
4949

5050
/**
5151
* Create with status code and message.
@@ -54,6 +54,8 @@ public HttpException(int statusCode, String message) {
5454
super(message);
5555
this.statusCode = statusCode;
5656
this.responseAsBytes = false;
57+
this.context = null;
58+
this.httpResponse = null;
5759
}
5860

5961
/**
@@ -63,6 +65,8 @@ public HttpException(int statusCode, String message, Throwable cause) {
6365
super(message, cause);
6466
this.statusCode = statusCode;
6567
this.responseAsBytes = false;
68+
this.context = null;
69+
this.httpResponse = null;
6670
}
6771

6872
/**
@@ -72,6 +76,8 @@ public HttpException(int statusCode, Throwable cause) {
7276
super(cause);
7377
this.statusCode = statusCode;
7478
this.responseAsBytes = false;
79+
this.context = null;
80+
this.httpResponse = null;
7581
}
7682

7783
HttpException(HttpResponse<?> httpResponse, DHttpClientContext context) {

0 commit comments

Comments
 (0)