Improve error message for group notice image upload

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:
手瓜一十雪 2025-11-07 20:00:17 +08:00
parent 457b072f0e
commit 93c140ed4e

View File

@ -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(() => { });