diff --git a/backend/src/main/java/com/qqchen/deploy/backend/notification/service/impl/NotificationTemplateServiceImpl.java b/backend/src/main/java/com/qqchen/deploy/backend/notification/service/impl/NotificationTemplateServiceImpl.java index a104f401..367e5586 100644 --- a/backend/src/main/java/com/qqchen/deploy/backend/notification/service/impl/NotificationTemplateServiceImpl.java +++ b/backend/src/main/java/com/qqchen/deploy/backend/notification/service/impl/NotificationTemplateServiceImpl.java @@ -113,12 +113,38 @@ public class NotificationTemplateServiceImpl extends BaseServiceImpl variableName [in template ...]" + if (errorMessage != null && errorMessage.contains("==> ")) { + int start = errorMessage.indexOf("==> ") + 4; + int end = errorMessage.indexOf(" ", start); + if (end == -1) { + end = errorMessage.indexOf("[", start); + } + if (end > start) { + return errorMessage.substring(start, end).trim(); + } + } + return "未知参数"; + } + @Override @Transactional public void enable(Long id) { diff --git a/backend/src/main/resources/messages.properties b/backend/src/main/resources/messages.properties index 0f49715a..32503c72 100644 --- a/backend/src/main/resources/messages.properties +++ b/backend/src/main/resources/messages.properties @@ -257,7 +257,7 @@ deploy.record.not.found=部署记录不存在 notification.template.not.found=通知模板不存在或已删除 notification.template.code.exists=模板编码{0}已存在 notification.template.disabled=通知模板已禁用 -notification.template.render.error=模板渲染失败 +notification.template.render.error=模板渲染失败:{0} # 通知渠道相关 (3120-3139) notification.channel.not.found=通知渠道不存在或已删除 diff --git a/backend/src/main/resources/messages_en_US.properties b/backend/src/main/resources/messages_en_US.properties index c6e6ea12..03a6c0d4 100644 --- a/backend/src/main/resources/messages_en_US.properties +++ b/backend/src/main/resources/messages_en_US.properties @@ -190,7 +190,7 @@ deploy.record.not.found=Deployment record not found notification.template.not.found=Notification template not found or has been deleted notification.template.code.exists=Template code {0} already exists notification.template.disabled=Notification template is disabled -notification.template.render.error=Template rendering failed +notification.template.render.error=Template rendering failed: {0} # Notification Channel Related (3120-3139) notification.channel.not.found=Notification channel not found or has been deleted diff --git a/backend/src/main/resources/messages_zh_CN.properties b/backend/src/main/resources/messages_zh_CN.properties index 555459d4..44050ad1 100644 --- a/backend/src/main/resources/messages_zh_CN.properties +++ b/backend/src/main/resources/messages_zh_CN.properties @@ -190,7 +190,7 @@ deploy.record.not.found=部署记录不存在 notification.template.not.found=通知模板不存在或已删除 notification.template.code.exists=模板编码{0}已存在 notification.template.disabled=通知模板已禁用 -notification.template.render.error=模板渲染失败 +notification.template.render.error=模板渲染失败:{0} # 通知渠道相关 (3120-3139) notification.channel.not.found=通知渠道不存在或已删除