diff --git a/application/src/main/java/run/halo/app/core/extension/theme/ThemeUtils.java b/application/src/main/java/run/halo/app/core/extension/theme/ThemeUtils.java index 6aa86a332..987dc6f4d 100644 --- a/application/src/main/java/run/halo/app/core/extension/theme/ThemeUtils.java +++ b/application/src/main/java/run/halo/app/core/extension/theme/ThemeUtils.java @@ -149,8 +149,8 @@ class ThemeUtils { new YamlUnstructuredLoader(new FileSystemResource(themeManifestPath)) .load(); if (CollectionUtils.isEmpty(unstructureds)) { - throw new IllegalArgumentException( - "The [theme.yaml] does not conform to the theme specification."); + throw new ThemeInstallationException("Missing theme manifest", + "problemDetail.theme.install.missingManifest", null); } return unstructureds.get(0); } diff --git a/application/src/main/resources/config/i18n/messages.properties b/application/src/main/resources/config/i18n/messages.properties index 5571afb25..c79daaeb4 100644 --- a/application/src/main/resources/config/i18n/messages.properties +++ b/application/src/main/resources/config/i18n/messages.properties @@ -39,7 +39,7 @@ problemDetail.comment.turnedOff=The comment function has been turned off. problemDetail.comment.systemUsersOnly=Allow only system users to comment problemDetail.theme.upgrade.missingManifest=Missing theme manifest file "theme.yaml" or "theme.yml". problemDetail.theme.upgrade.nameMismatch=The current theme name {0} did not match the installed theme name. -problemDetail.theme.install.missingManifest=Missing theme manifest file "theme.yaml" or "theme.yml". +problemDetail.theme.install.missingManifest=Missing theme manifest file "theme.yaml" or manifest file does not conform to the theme specification. problemDetail.theme.install.alreadyExists=Theme {0} already exists. problemDetail.theme.version.unsatisfied.requires=The theme requires a minimum system version of {0}, but the current version is {1}. problemDetail.directoryTraversal=Directory traversal detected. Base path is {0}, but real path is {1}. diff --git a/application/src/main/resources/config/i18n/messages_zh.properties b/application/src/main/resources/config/i18n/messages_zh.properties index b98f51246..636502628 100644 --- a/application/src/main/resources/config/i18n/messages_zh.properties +++ b/application/src/main/resources/config/i18n/messages_zh.properties @@ -4,6 +4,7 @@ problemDetail.title.run.halo.app.infra.exception.PluginInstallationException=插 problemDetail.title.run.halo.app.infra.exception.AttachmentAlreadyExistsException=附件已存在 problemDetail.title.run.halo.app.infra.exception.DuplicateNameException=名称重复 problemDetail.title.run.halo.app.infra.exception.PluginAlreadyExistsException=插件已存在 +problemDetail.title.run.halo.app.infra.exception.ThemeInstallationException=主题安装失败 problemDetail.run.halo.app.infra.exception.AttachmentAlreadyExistsException=文件 {0} 已存在,建议更名后重试。 problemDetail.run.halo.app.infra.exception.DuplicateNameException=检测到有重复的名称,请重命名后重试。 @@ -14,4 +15,5 @@ problemDetail.user.duplicateName=用户名 {0} 已存在,请更换用户名后 problemDetail.plugin.version.unsatisfied.requires=插件要求一个最小的系统版本为 {0}, 但当前版本为 {1}。 -problemDetail.theme.version.unsatisfied.requires=主题要求一个最小的系统版本为 {0}, 但当前版本为 {1}。 \ No newline at end of file +problemDetail.theme.version.unsatisfied.requires=主题要求一个最小的系统版本为 {0}, 但当前版本为 {1}。 +problemDetail.theme.install.missingManifest=缺少 theme.yaml 配置文件或配置文件不符合规范。 \ No newline at end of file