feat: set ServerResponseMalformedException's message to response content
This commit is contained in:
@@ -221,11 +221,7 @@ public class YggdrasilService {
|
|||||||
if (StringUtils.isBlank(response))
|
if (StringUtils.isBlank(response))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
try {
|
handleErrorMessage(fromJson(response, ErrorResponse.class));
|
||||||
handleErrorMessage(fromJson(response, ErrorResponse.class));
|
|
||||||
} catch (JsonParseException e) {
|
|
||||||
throw new ServerResponseMalformedException(e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void handleErrorMessage(ErrorResponse response) throws AuthenticationException {
|
private static void handleErrorMessage(ErrorResponse response) throws AuthenticationException {
|
||||||
@@ -249,7 +245,7 @@ public class YggdrasilService {
|
|||||||
try {
|
try {
|
||||||
return GSON.fromJson(text, typeOfT);
|
return GSON.fromJson(text, typeOfT);
|
||||||
} catch (JsonParseException e) {
|
} catch (JsonParseException e) {
|
||||||
throw new ServerResponseMalformedException(e);
|
throw new ServerResponseMalformedException(text, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user