Convert all filesystem error types into the same Error struct

This commit is contained in:
Dane Everitt
2020-12-15 20:51:13 -08:00
parent 9ae75a399b
commit 3a26a5d39d
11 changed files with 104 additions and 75 deletions

View File

@@ -40,7 +40,7 @@ func (fs *Filesystem) GetIncludedFiles(dir string, ignored []string) (*backup.In
if e.IsSymlink() {
sp, err = fs.SafePath(p)
if err != nil {
if IsBadPathResolutionError(err) {
if IsErrorCode(err, ErrCodePathResolution) {
return godirwalk.SkipThis
}
@@ -114,7 +114,7 @@ func (fs *Filesystem) CompressFiles(dir string, paths []string) (os.FileInfo, er
// use the resolved location for the rest of this function.
sp, err = fs.SafePath(p)
if err != nil {
if IsBadPathResolutionError(err) {
if IsErrorCode(err, ErrCodePathResolution) {
return godirwalk.SkipThis
}