mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2026-10-10 04:53:09 +08:00
893457cd50
* fix(aliyundrive): limit callback concurrency - Share proxy callback admission by Aliyun user identity and hold permits for complete response-body lifetimes. - Retry only verified callback-capacity rejections while preserving direct redirects and server download limiting. - Map exhausted temporary capacity to S3 SlowDown through the merged OpenListTeam gofakes3 module. - Cover shared limits, lifecycle release, cancellation, retry classification, and the S3 HTTP response. Co-authored-by: Codex <267193182+codex@users.noreply.github.com> # Conflicts: # go.mod # go.sum # server/s3/pager.go * fix(op): separate redirect and proxy link cache entries - Include redirect mode in the link cache key for all drivers. - Cover both redirect-to-proxy and proxy-to-redirect cache reuse. Co-authored-by: Codex <267193182+codex@users.noreply.github.com> * fix(proxy): close range bodies before opening next - make ServeHTTP own each range body and preserve cleanup failures - remove the aggregate range closer and pass range readers directly - replace the obsolete callback transport test with focused lifecycle coverage Co-authored-by: Codex <267193182+codex@users.noreply.github.com> --------- Co-authored-by: nostalume <nostalucent@gmail.com> Co-authored-by: Codex <267193182+codex@users.noreply.github.com>
48 lines
1.6 KiB
Go
48 lines
1.6 KiB
Go
package errs
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
|
|
pkgerr "github.com/pkg/errors"
|
|
)
|
|
|
|
var (
|
|
NotImplement = errors.New("not implement")
|
|
NotSupport = errors.New("not support")
|
|
RelativePath = errors.New("using relative path is not allowed")
|
|
|
|
UploadNotSupported = errors.New("upload not supported")
|
|
MetaNotFound = errors.New("meta not found")
|
|
StorageNotFound = errors.New("storage not found")
|
|
StorageNotInit = errors.New("storage not init")
|
|
StreamIncomplete = errors.New("upload/download stream incomplete, possible network issue")
|
|
StreamPeekFail = errors.New("StreamPeekFail")
|
|
TemporaryCapacity = errors.New("temporary capacity unavailable")
|
|
|
|
UnknownArchiveFormat = errors.New("unknown archive format")
|
|
WrongArchivePassword = errors.New("wrong archive password")
|
|
DriverExtractNotSupported = errors.New("driver extraction not supported")
|
|
|
|
WrongShareCode = errors.New("wrong share code")
|
|
InvalidSharing = errors.New("invalid sharing")
|
|
SharingNotFound = errors.New("sharing not found")
|
|
)
|
|
|
|
// NewErr wrap constant error with an extra message
|
|
// use errors.Is(err1, StorageNotFound) to check if err belongs to any internal error
|
|
func NewErr(err error, format string, a ...any) error {
|
|
return fmt.Errorf("%w; %s", err, fmt.Sprintf(format, a...))
|
|
}
|
|
|
|
func IsNotFoundError(err error) bool {
|
|
return errors.Is(pkgerr.Cause(err), ObjectNotFound) || errors.Is(pkgerr.Cause(err), StorageNotFound)
|
|
}
|
|
|
|
func IsNotSupportError(err error) bool {
|
|
return errors.Is(pkgerr.Cause(err), NotSupport)
|
|
}
|
|
func IsNotImplementError(err error) bool {
|
|
return errors.Is(pkgerr.Cause(err), NotImplement)
|
|
}
|