mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 08:30:42 +02:00
🎨 Improve upload asset to cloud error message
This commit is contained in:
parent
1ce56dee21
commit
6bd1772f13
1 changed files with 6 additions and 2 deletions
|
@ -606,6 +606,7 @@ func uploadAssets2Cloud(assetPaths []string, bizType string) (count int, err err
|
||||||
metaType = "4"
|
metaType = "4"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pushErrMsgCount := 0
|
||||||
var completedUploadAssets []string
|
var completedUploadAssets []string
|
||||||
for _, absAsset := range uploadAbsAssets {
|
for _, absAsset := range uploadAbsAssets {
|
||||||
fi, statErr := os.Stat(absAsset)
|
fi, statErr := os.Stat(absAsset)
|
||||||
|
@ -616,8 +617,11 @@ func uploadAssets2Cloud(assetPaths []string, bizType string) (count int, err err
|
||||||
|
|
||||||
if limitSize < uint64(fi.Size()) {
|
if limitSize < uint64(fi.Size()) {
|
||||||
logging.LogWarnf("file [%s] larger than limit size [%s], ignore uploading it", absAsset, humanize.IBytes(limitSize))
|
logging.LogWarnf("file [%s] larger than limit size [%s], ignore uploading it", absAsset, humanize.IBytes(limitSize))
|
||||||
msg := fmt.Sprintf(Conf.Language(247), filepath.Base(absAsset), humanize.IBytes(limitSize))
|
if 3 > pushErrMsgCount {
|
||||||
util.PushErrMsg(msg, 30000)
|
msg := fmt.Sprintf(Conf.Language(247), filepath.Base(absAsset), humanize.IBytes(limitSize))
|
||||||
|
util.PushErrMsg(msg, 30000)
|
||||||
|
}
|
||||||
|
pushErrMsgCount++
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue