ZYKsslm / nonebot_plugin_zyk_novelai

一个用于nonebot2的简约AI绘图插件
MIT License
35 stars 5 forks source link

后端报错导致插件一直处于占用中 #7

Closed ProblemFactory closed 1 year ago

ProblemFactory commented 1 year ago

在work.py的get_data中有可能网络请求失败或是其他原因导致后端返回错误未能被124行的正则匹配,导致出现以下错误:

  File ".../nonebot_plugin_zyk_novelai/work.py", line 124, in get_data
    error = findall(r'"error":"(?P<error>.*?)"', info)[0]
IndexError: list index out of range

出错后机器人会一直处于资源占用中状态而拒绝回应绘图指令。

ZYKsslm commented 1 year ago

已经修复了,是以图生图参数为None的问题

ProblemFactory commented 1 year ago

我是在最新版本用随机tag绘图的时候遇到的这个问题,但log里没记录到底当时后端返回的内容是啥。最好还是在get_data里处理一下吧。