Cloudreve/pkg/filesystem/errors.go

25 lines
1.4 KiB
Go
Raw Normal View History

2019-11-17 13:50:14 +08:00
package filesystem
2019-11-26 20:59:57 +08:00
import (
"errors"
"github.com/HFO4/cloudreve/pkg/serializer"
)
2019-11-17 13:50:14 +08:00
var (
ErrUnknownPolicyType = errors.New("未知存储策略类型")
ErrFileSizeTooBig = errors.New("单个文件尺寸太大")
ErrFileExtensionNotAllowed = errors.New("不允许上传此类型的文件")
ErrInsufficientCapacity = errors.New("容量空间不足")
ErrIllegalObjectName = errors.New("目标名称非法")
ErrClientCanceled = errors.New("客户端取消操作")
2020-02-03 13:23:33 +08:00
ErrRootProtected = errors.New("无法对根目录进行操作")
2019-11-26 20:59:57 +08:00
ErrInsertFileRecord = serializer.NewError(serializer.CodeDBError, "无法插入文件记录", nil)
ErrFileExisted = serializer.NewError(serializer.CodeObjectExist, "同名文件或目录已存在", nil)
ErrFolderExisted = serializer.NewError(serializer.CodeObjectExist, "同名目录已存在", nil)
2019-11-26 20:59:57 +08:00
ErrPathNotExist = serializer.NewError(404, "路径不存在", nil)
ErrObjectNotExist = serializer.NewError(404, "文件不存在", nil)
ErrIO = serializer.NewError(serializer.CodeIOFailed, "无法读取文件数据", nil)
2019-11-30 15:09:56 +08:00
ErrDBListObjects = serializer.NewError(serializer.CodeDBError, "无法列取对象记录", nil)
2019-12-01 14:31:29 +08:00
ErrDBDeleteObjects = serializer.NewError(serializer.CodeDBError, "无法删除对象记录", nil)
2019-11-17 13:50:14 +08:00
)