Skip to content

Commit

Permalink
fix: 将 Exception 的 render 修改为使用 message
Browse files Browse the repository at this point in the history
  • Loading branch information
BigOrangeQWQ committed Nov 1, 2024
1 parent 2dbef65 commit b4b849d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/plugins/github/plugins/remove/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
**{{ "✅ 所有检查通过,一切准备就绪!" if valid else "⚠️ 在下架检查过程中,我们发现以下问题:"}}**

{% if not valid %}
> ⚠️ {{ error.message_template }}
> ⚠️ {{ error }}
{% else %}
> 发起插件下架流程!
{% endif %}
Expand Down

0 comments on commit b4b849d

Please sign in to comment.