Improve error message for group notice image upload
Build Action / Build-LiteLoader (push) Canceled after 0s
Build Action / Build-Shell (push) Canceled after 0s
Build Release / check-version (push) Canceled after 0s
Build Release / Build-LiteLoader (push) Canceled after 0s
Build Release / Build-Shell (push) Canceled after 0s
Build Release / release-napcat (push) Canceled after 0s
Build Release / build-docker (push) Canceled after 0s

Enhanced the error message when group notice image upload fails to include the error details from the upload API response.
This commit is contained in:
手瓜一十雪 committed 2025-11-07 20:00:17 +08:00
1 parent 457b072f0e
commit 93c140ed4e
1 file changed
+1 -1
@@ -37,7 +37,7 @@ export class SendGroupNotice extends OneBotAction<Payload, null> {
await checkFileExist(path, 5000);
const ImageUploadResult = await this.core.apis.GroupApi.uploadGroupBulletinPic(payload.group_id.toString(), path);
if (ImageUploadResult.errCode !== 0) {
throw new Error(`群公告${payload.image}设置失败,图片上传失败`);
throw new Error(`群公告${payload.image}设置失败,图片上传失败 , 错误信息:${ImageUploadResult.errMsg}`);
}
unlink(path).catch(() => { });