mirror: Fix removal of FS target without a trailing slash (#4560)

This commit is contained in:
Anis Eleuch
2023-05-04 11:10:16 -07:00
committed by GitHub
parent b005b9a94d
commit 5a0d5116f4
6 changed files with 152 additions and 24 deletions
+12 -5
View File
@@ -115,39 +115,46 @@ type GenericFileError struct {
Path string
}
// PathNotADirectory - this path does not correspond to a directory
type PathNotADirectory GenericFileError
func (e PathNotADirectory) Error() string {
return "Requested path `" + e.Path + "` not a directory"
}
// PathNotFound (ENOENT) - file not found.
type PathNotFound GenericFileError
func (e PathNotFound) Error() string {
return "Requested file `" + e.Path + "` not found"
return "Requested path `" + e.Path + "` not found"
}
// PathIsNotRegular (ENOTREG) - file is not a regular file.
type PathIsNotRegular GenericFileError
func (e PathIsNotRegular) Error() string {
return "Requested file `" + e.Path + "` is not a regular file."
return "Requested path `" + e.Path + "` is not a regular file."
}
// PathInsufficientPermission (EPERM) - permission denied.
type PathInsufficientPermission GenericFileError
func (e PathInsufficientPermission) Error() string {
return "Insufficient permissions to access this file `" + e.Path + "`"
return "Insufficient permissions to access this path `" + e.Path + "`"
}
// BrokenSymlink (ENOTENT) - file has broken symlink.
type BrokenSymlink GenericFileError
func (e BrokenSymlink) Error() string {
return "Requested file `" + e.Path + "` has broken symlink"
return "Requested path `" + e.Path + "` has broken symlink"
}
// TooManyLevelsSymlink (ELOOP) - file has too many levels of symlinks.
type TooManyLevelsSymlink GenericFileError
func (e TooManyLevelsSymlink) Error() string {
return "Requested file `" + e.Path + "` has too many levels of symlinks"
return "Requested path `" + e.Path + "` has too many levels of symlinks"
}
// EmptyPath (EINVAL) - invalid argument.