alist/internal/errs/object.go

17 lines
309 B
Go
Raw Normal View History

2022-06-23 08:09:22 +00:00
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 {
2022-06-25 12:38:02 +00:00
return errors.Is(pkgerr.Cause(err), ObjectNotFound)
2022-06-23 08:09:22 +00:00
}