fix: check Close() error on feishu resource download
This commit is contained in:
parent
7d2b0c2a4d
commit
b1d727ebaf
1 changed files with 7 additions and 1 deletions
|
|
@ -1013,7 +1013,13 @@ func (c *FeishuChannel) storeResourceFile(
|
||||||
})
|
})
|
||||||
return ""
|
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{
|
ref, err := store.Store(localPath, media.MediaMeta{
|
||||||
Filename: filename,
|
Filename: filename,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue