diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/InstallerWizardProvider.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/InstallerWizardProvider.java index f6edfcae9..913614d35 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/InstallerWizardProvider.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/download/InstallerWizardProvider.java @@ -35,6 +35,7 @@ import org.jackhuang.hmcl.ui.wizard.WizardController; import org.jackhuang.hmcl.ui.wizard.WizardProvider; import org.jackhuang.hmcl.util.StringUtils; +import java.net.SocketTimeoutException; import java.util.Map; import static org.jackhuang.hmcl.util.i18n.I18n.i18n; @@ -125,7 +126,11 @@ public final class InstallerWizardProvider implements WizardProvider { if (exception instanceof LibraryDownloadException) { Controllers.dialog(i18n("launch.failed.download_library", ((LibraryDownloadException) exception).getLibrary().getName()) + "\n" + StringUtils.getStackTrace(exception.getCause()), i18n("install.failed.downloading"), MessageType.ERROR, next); } else if (exception instanceof DownloadException) { - Controllers.dialog(i18n("install.failed.downloading.detail", ((DownloadException) exception).getUrl()) + "\n" + StringUtils.getStackTrace(exception.getCause()), i18n("install.failed.downloading"), MessageType.ERROR, next); + if (exception.getCause() instanceof SocketTimeoutException) { + Controllers.dialog(i18n("install.failed.downloading.timeout", ((DownloadException) exception).getUrl()), i18n("install.failed.downloading"), MessageType.ERROR, next); + } else { + Controllers.dialog(i18n("install.failed.downloading.detail", ((DownloadException) exception).getUrl()) + "\n" + StringUtils.getStackTrace(exception.getCause()), i18n("install.failed.downloading"), MessageType.ERROR, next); + } } else if (exception instanceof OptiFineInstallTask.UnsupportedOptiFineInstallationException) { Controllers.dialog(i18n("install.failed.optifine_conflict"), i18n("install.failed"), MessageType.ERROR, next); } else { diff --git a/HMCL/src/main/resources/assets/lang/I18N.properties b/HMCL/src/main/resources/assets/lang/I18N.properties index f45977fff..2f21821d3 100644 --- a/HMCL/src/main/resources/assets/lang/I18N.properties +++ b/HMCL/src/main/resources/assets/lang/I18N.properties @@ -129,6 +129,7 @@ install.change_version.confirm=Sure to update %s from verison %s to %s? install.failed=Failed to install install.failed.downloading=Failed to install due to some files not downloaded successfully install.failed.downloading.detail=Failed to download file: %s +install.failed.downloading.timeout=Download timed out: %s install.failed.optifine_conflict=OptiFine and Forge are both installed simultaneously on Minecraft 1.13 install.installer.choose=Choose a %s version install.installer.forge=Forge diff --git a/HMCL/src/main/resources/assets/lang/I18N_zh.properties b/HMCL/src/main/resources/assets/lang/I18N_zh.properties index 4746d4dc2..ce2333b36 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_zh.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_zh.properties @@ -128,6 +128,7 @@ install.change_version.confirm=你確定要將 %s 從 %s 更新到 %s 嗎? install.failed=安裝失敗 install.failed.downloading=安裝失敗,部分文件未能完成下載 install.failed.downloading.detail=未能下載檔案:%s +install.failed.downloading.timeout=下載超時:%s install.failed.optifine_conflict=暫不支持 OptiFine 與 Forge 同時安裝於 Minecraft 1.13 install.installer.choose=選擇 %s 版本 install.installer.forge=Forge diff --git a/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties b/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties index afb5e958f..196b1925e 100644 --- a/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties +++ b/HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties @@ -128,6 +128,7 @@ install.change_version.confirm=你确定要将 %s 从 %s 更新到 %s 吗? install.failed=安装失败 install.failed.downloading=安装失败,部分文件未能完成下载 install.failed.downloading.detail=未能下载文件:%s +install.failed.downloading.timeout=下载超时:%s install.failed.optifine_conflict=暂不支持 OptiFine 与 Forge 同时安装于 Minecraft 1.13 install.installer.choose=选择 %s 版本 install.installer.forge=Forge