Skip to content

Commit

Permalink
feat(fs): display the existing filename in error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Lanfei committed Jan 25, 2025
1 parent c2633dd commit d337fca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/handles/fsmanage.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func FsMove(c *gin.Context) {
if !req.Overwrite {
for _, name := range req.Names {
if res, _ := fs.Get(c, stdpath.Join(dstDir, name), &fs.GetArgs{NoLog: true}); res != nil {
common.ErrorStrResp(c, "file exists", 403)
common.ErrorStrResp(c, fmt.Sprintf("file [%s] exists", name), 403)
return
}
}
Expand Down Expand Up @@ -133,7 +133,7 @@ func FsCopy(c *gin.Context) {
if !req.Overwrite {
for _, name := range req.Names {
if res, _ := fs.Get(c, stdpath.Join(dstDir, name), &fs.GetArgs{NoLog: true}); res != nil {
common.ErrorStrResp(c, "file exists", 403)
common.ErrorStrResp(c, fmt.Sprintf("file [%s] exists", name), 403)
return
}
}
Expand Down Expand Up @@ -180,7 +180,7 @@ func FsRename(c *gin.Context) {
dstPath := stdpath.Join(stdpath.Dir(reqPath), req.Name)
if dstPath != reqPath {
if res, _ := fs.Get(c, dstPath, &fs.GetArgs{NoLog: true}); res != nil {
common.ErrorStrResp(c, "file exists", 403)
common.ErrorStrResp(c, fmt.Sprintf("file [%s] exists", req.Name), 403)
return
}
}
Expand Down

0 comments on commit d337fca

Please sign in to comment.