add response headers to api exception (#12042)

This commit is contained in:
William Cheng
2022-04-05 17:24:41 +08:00
committed by GitHub
parent 4e16146638
commit 5cef7e613a
2 changed files with 2 additions and 2 deletions

View File

@@ -1197,7 +1197,7 @@ public class ApiClient {
try {
Response response = call.execute();
if (!response.isSuccessful()) {
throw new ApiException(response.code(), response.message());
throw new ApiException(response.code(), response.message(), response.headers().toMultimap(), null);
}
if (response.body() == null) {
return null;

View File

@@ -993,7 +993,7 @@ public class ApiClient {
try {
Response response = call.execute();
if (!response.isSuccessful()) {
throw new ApiException(response.code(), response.message());
throw new ApiException(response.code(), response.message(), response.headers().toMultimap(), null);
}
if (response.body() == null) {
return null;