mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Feat: custom error for general layer codes
This commit is contained in:
@@ -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("不是人都的"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user