fix: check Close() error on feishu resource download

This commit is contained in:
程智超0668000959
2026-06-07 11:56:09 +08:00
parent 7d2b0c2a4d
commit b1d727ebaf
+7 -1
View File
@@ -1013,7 +1013,13 @@ func (c *FeishuChannel) storeResourceFile(
})
return ""
}
out.Close()
if err := out.Close(); err != nil {
logger.ErrorCF("feishu", "Failed to close downloaded resource file", map[string]any{
"error": err.Error(),
})
os.Remove(localPath)
return ""
}
ref, err := store.Store(localPath, media.MediaMeta{
Filename: filename,