mirror of https://github.com/Xhofe/alist
18 lines
310 B
Go
18 lines
310 B
Go
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 errors.Is(pkgerr.Cause(err), ObjectNotFound)
|
|
}
|