From b4b849da9f29c5d85d73058d1956e8d26d2c81e3 Mon Sep 17 00:00:00 2001 From: BigOrangeQWQ <2284086963@qq.com> Date: Sat, 2 Nov 2024 01:07:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B0=86=20Exception=20=E7=9A=84=20rend?= =?UTF-8?q?er=20=E4=BF=AE=E6=94=B9=E4=B8=BA=E4=BD=BF=E7=94=A8=20message?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/github/plugins/remove/render.py | 4 +++- src/plugins/github/plugins/remove/templates/comment.md.jinja | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/github/plugins/remove/render.py b/src/plugins/github/plugins/remove/render.py index 18254de6..bdb9ee6d 100644 --- a/src/plugins/github/plugins/remove/render.py +++ b/src/plugins/github/plugins/remove/render.py @@ -26,4 +26,6 @@ async def render_comment(result: RemoveInfo) -> str: async def render_error(exception: PydanticCustomError): """将错误转换成评论内容""" template = env.get_template("comment.md.jinja") - return await template.render_async(title="Error", valid=False, error=exception) + return await template.render_async( + title="Error", valid=False, error=exception.message() + ) diff --git a/src/plugins/github/plugins/remove/templates/comment.md.jinja b/src/plugins/github/plugins/remove/templates/comment.md.jinja index 5ede4fe0..99af0202 100644 --- a/src/plugins/github/plugins/remove/templates/comment.md.jinja +++ b/src/plugins/github/plugins/remove/templates/comment.md.jinja @@ -5,7 +5,7 @@ **{{ "✅ 所有检查通过,一切准备就绪!" if valid else "⚠️ 在下架检查过程中,我们发现以下问题:"}}** {% if not valid %} -> ⚠️ {{ error.message_template }} +> ⚠️ {{ error }} {% else %} > 发起插件下架流程! {% endif %}