mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-07 08:06:37 +08:00
autoresearch iter 3: share upload-record error mapping via filesrv helper
ServeFileByID and DownloadFile duplicated the lookup failure mapping and each used an unchecked *strconv.NumError assertion that cannot match a wrapped error. One helper now classifies 404 vs 400 via errors.As; each endpoint keeps its own fallback for unclassified failures. ErrInvalidUploadID became unused once both sites report ErrInvalidFileID for a malformed ID.
This commit is contained in:
@@ -43,7 +43,6 @@ const (
|
||||
ErrFileRecordNotFound = "文件记录未找到"
|
||||
ErrFileNotFound = "文件未找到"
|
||||
ErrOperationForbidden = "无权操作"
|
||||
ErrInvalidUploadID = "无效的上传ID"
|
||||
ErrInvalidAccessModeParam = "无效的 access_mode 参数"
|
||||
ErrInternalServerError = "服务器内部错误"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user