feat: set ServerResponseMalformedException's message to response content

This commit is contained in:
Haowei Wen
2021-02-17 22:52:38 +08:00
committed by Yuhui Huang
parent ac1f2ec1ed
commit 65952a5d81

View File

@@ -221,11 +221,7 @@ public class YggdrasilService {
if (StringUtils.isBlank(response))
return;
try {
handleErrorMessage(fromJson(response, ErrorResponse.class));
} catch (JsonParseException e) {
throw new ServerResponseMalformedException(e);
}
handleErrorMessage(fromJson(response, ErrorResponse.class));
}
private static void handleErrorMessage(ErrorResponse response) throws AuthenticationException {
@@ -249,7 +245,7 @@ public class YggdrasilService {
try {
return GSON.fromJson(text, typeOfT);
} catch (JsonParseException e) {
throw new ServerResponseMalformedException(e);
throw new ServerResponseMalformedException(text, e);
}
}