-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[Feature]在插件加载失败时提供“填写配置”选项 #8592
Copy link
Copy link
Open
Labels
area:coreThe bug / feature is about astrbot's core, backendThe bug / feature is about astrbot's core, backendenhancementNew feature or requestNew feature or requestfeature:pluginThe bug / feature is about AstrBot plugin system.The bug / feature is about AstrBot plugin system.
Metadata
Metadata
Assignees
Labels
area:coreThe bug / feature is about astrbot's core, backendThe bug / feature is about astrbot's core, backendenhancementNew feature or requestNew feature or requestfeature:pluginThe bug / feature is about AstrBot plugin system.The bug / feature is about AstrBot plugin system.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Description / 描述
如题,在当前版本,插件加载失败只会有“重载”和“卸载”两种选择。
如果插件的配置文件不能满足作者需求,作者需要在插件载入时校验配置项,配置不合法的唯一方法就是logger记录错误并且宽容启动。(如果raise error会导致UI界面根本没有填写配置的选项)
在这种情况下,插件作者能做的最多只有给个默认值;如果能在插件载入失败时提供重新填写配置的选择,插件就可以在载入时立刻抛出错误,用户也能知道自己哪里填写不符合规范从而更改自己的配置而不是让插件以错误的配置跑起来。
Use Case / 使用场景
载入插件失败时
Willing to Submit PR? / 是否愿意提交PR?
Code of Conduct