Feat: custom error for general layer codes

This commit is contained in:
HFO4
2019-11-26 19:51:54 +08:00
parent 9a1665526c
commit a734493b65
5 changed files with 89 additions and 0 deletions

View File

@@ -2,7 +2,10 @@ package filesystem
import (
"context"
"errors"
model "github.com/HFO4/cloudreve/models"
"github.com/HFO4/cloudreve/pkg/serializer"
"io"
)
/* ============
@@ -32,3 +35,8 @@ func (fs *FileSystem) AddFile(ctx context.Context, parent *model.Folder) (*model
return &newFile, nil
}
// Download 处理下载文件请求
func (fs *FileSystem) Download(ctx context.Context, path string) (io.ReadCloser, error) {
return nil, serializer.NewError(serializer.CodeEncryptError, "人都的", errors.New("不是人都的"))
}