8000 feat(fs): display the existing filename in error message (#7877) · AlistGo/alist@0d4c63e · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 0d4c63e

Browse files
authored
feat(fs): display the existing filename in error message (#7877)
1 parent 5c5d837 commit 0d4c63e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/handles/fsmanage.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func FsMove(c *gin.Context) {
9090
if !req.Overwrite {
9191
for _, name := range req.Names {
9292
if res, _ := fs.Get(c, stdpath.Join(dstDir, name), &fs.GetArgs{NoLog: true}); res != nil {
93-
common.ErrorStrResp(c, "file exists", 403)
93+
common.ErrorStrResp(c, fmt.Sprintf("file [%s] exists", name), 403)
9494
return
9595
}
9696
}
@@ -133,7 +133,7 @@ func FsCopy(c *gin.Context) {
133133
if !req.Overwrite {
134134
for _, name := range req.Names {
135135
if res, _ := fs.Get(c, stdpath.Join(dstDir, name), &fs.GetArgs{NoLog: true}); res != nil {
136-
common.ErrorStrResp(c, "file exists", 403)
136+
common.ErrorStrResp(c, fmt.Sprintf("file [%s] exists", name), 403)
137137
return
138138
}
139139
}
@@ -180,7 +180,7 @@ func FsRename(c *gin.Context) {
180180
dstPath := stdpath.Join(stdpath.Dir(reqPath), req.Name)
181181
if dstPath != reqPath {
182182
if res, _ := fs.Get(c, dstPath, &fs.GetArgs{NoLog: true}); res != nil {
183-
common.ErrorStrResp(c, "file exists", 403)
183+
common.ErrorStrResp(c, fmt.Sprintf("file [%s] exists", req.Name), 403)
184184
return
185185
}
186186
}

0 commit comments

Comments
 (0)
0