Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
burningtnt committed Dec 2, 2023
1 parent bd39178 commit d4966b5
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.jackhuang.hmcl.task.FileDownloadTask;
import org.jackhuang.hmcl.task.FileDownloadTask.IntegrityCheck;
import org.jackhuang.hmcl.util.gson.JsonUtils;
import org.jackhuang.hmcl.util.io.NetworkUtils;
import org.jackhuang.hmcl.util.io.HttpRequest;

import java.io.IOException;
import java.net.URL;
Expand Down Expand Up @@ -102,7 +102,7 @@ private void update() throws IOException {
Optional.ofNullable(latest.checksums.get("sha256"))
.map(checksum -> new IntegrityCheck("SHA-256", checksum))
.orElse(null))
.run();
.run();
} catch (Exception e) {
throw new IOException("Failed to download authlib-injector", e);
}
Expand All @@ -113,9 +113,9 @@ private void update() throws IOException {
private AuthlibInjectorVersionInfo getLatestArtifactInfo() throws IOException {
try {
return JsonUtils.fromNonNullJson(
NetworkUtils.doGet(
new URL(downloadProvider.get().injectURL(LATEST_BUILD_URL))),
AuthlibInjectorVersionInfo.class);
HttpRequest.GET(downloadProvider.get().injectURL(LATEST_BUILD_URL)).getString(),
AuthlibInjectorVersionInfo.class
);
} catch (JsonParseException e) {
throw new IOException("Malformed response", e);
}
Expand Down

0 comments on commit d4966b5

Please sign in to comment.