mirror of
https://github.com/HChaZZY/alist.git
synced 2025-12-20 17:16:39 +08:00
feat: dir and file check
This commit is contained in:
16
internal/errs/object.go
Normal file
16
internal/errs/object.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package errs
|
||||
|
||||
import (
|
||||
"errors"
|
||||
pkgerr "github.com/pkg/errors"
|
||||
)
|
||||
|
||||
var (
|
||||
ObjectNotFound = errors.New("object not found")
|
||||
NotFolder = errors.New("not a folder")
|
||||
NotFile = errors.New("not a file")
|
||||
)
|
||||
|
||||
func IsObjectNotFound(err error) bool {
|
||||
return pkgerr.Cause(err) == ObjectNotFound
|
||||
}
|
||||
Reference in New Issue
Block a user