Documentation
¶
Overview ¶
Package errors/check.go
Package errors/codes.go
Package errors/errors.go
Index ¶
- func IsAccessDenied(err error) bool
- func IsBucketExists(err error) bool
- func IsBucketNotEmpty(err error) bool
- func IsBucketNotFound(err error) bool
- func IsInvalidArgument(err error) bool
- func IsNotFound(err error) bool
- func IsObjectNotFound(err error) bool
- func IsRetryable(err error) bool
- func IsServiceUnavailable(err error) bool
- func ParseErrorResponse(resp *http.Response, bucketName, objectName string) error
- type APIError
- func (e *APIError) Code() RustfsGoErrorCode
- func (e *APIError) Error() string
- func (e *APIError) Message() string
- func (e *APIError) RequestID() string
- func (e *APIError) Resource() string
- func (e *APIError) StatusCode() int
- func (e *APIError) WithRegion(region string) *APIError
- func (e *APIError) WithRequestID(id string) *APIError
- func (e *APIError) WithResource(resource string) *APIError
- type Error
- type RustfsGoErrorCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsServiceUnavailable ¶
IsServiceUnavailable 检查服务是否不可用
Types ¶
type APIError ¶
type APIError struct {
XMLName xml.Name `xml:"Error"`
ErrorCode string `xml:"Code"`
ErrorMessage string `xml:"Message"`
ErrorResource string `xml:"Resource"`
ErrorRequestID string `xml:"RequestId"`
HostID string `xml:"HostId"`
ErrorStatusCode int `xml:"-"`
Region string `xml:"Region"`
}
APIError S3 API 错误
func NewAPIError ¶
func NewAPIError(code RustfsGoErrorCode, message string, statusCode int) *APIError
NewAPIError 创建新的 API 错误
func (*APIError) WithRegion ¶
WithRegion 设置区域
func (*APIError) WithRequestID ¶
WithRequestID 设置请求 ID
func (*APIError) WithResource ¶
WithResource 设置资源
type Error ¶
type Error interface {
error
Code() RustfsGoErrorCode
Message() string
StatusCode() int
RequestID() string
Resource() string
}
Error RustFS 错误接口
type RustfsGoErrorCode ¶
type RustfsGoErrorCode string
RustfsGoErrorCode 定义了 RustfsGo 错误码的类型
const ( // 桶相关 ErrCodeNoSuchBucket RustfsGoErrorCode = "NoSuchBucket" ErrCodeBucketAlreadyExists RustfsGoErrorCode = "BucketAlreadyExists" ErrCodeBucketAlreadyOwnedByYou RustfsGoErrorCode = "BucketAlreadyOwnedByYou" ErrCodeBucketNotEmpty RustfsGoErrorCode = "BucketNotEmpty" ErrCodeInvalidBucketName RustfsGoErrorCode = "InvalidBucketName" // 对象相关 ErrCodeNoSuchKey RustfsGoErrorCode = "NoSuchKey" ErrCodeInvalidObjectName RustfsGoErrorCode = "XRustfsInvalidObjectName" ErrCodeNoSuchUpload RustfsGoErrorCode = "NoSuchUpload" ErrCodeNoSuchVersion RustfsGoErrorCode = "NoSuchVersion" ErrCodeInvalidPart RustfsGoErrorCode = "InvalidPart" ErrCodeInvalidPartOrder RustfsGoErrorCode = "InvalidPartOrder" ErrCodeEntityTooLarge RustfsGoErrorCode = "EntityTooLarge" ErrCodeEntityTooSmall RustfsGoErrorCode = "EntityTooSmall" // 访问控制 ErrCodeAccessDenied RustfsGoErrorCode = "AccessDenied" ErrCodeAccountProblem RustfsGoErrorCode = "AccountProblem" ErrCodeInvalidAccessKeyId RustfsGoErrorCode = "InvalidAccessKeyId" ErrCodeSignatureDoesNotMatch RustfsGoErrorCode = "SignatureDoesNotMatch" // 请求相关 ErrCodeInvalidArgument RustfsGoErrorCode = "InvalidArgument" ErrCodeInvalidRequest RustfsGoErrorCode = "InvalidRequest" ErrCodeMalformedXML RustfsGoErrorCode = "MalformedXML" ErrCodeMissingContentLength RustfsGoErrorCode = "MissingContentLength" ErrCodeMethodNotAllowed RustfsGoErrorCode = "MethodNotAllowed" // 区域相关 ErrCodeInvalidRegion RustfsGoErrorCode = "InvalidRegion" ErrCodeAuthorizationHeaderMalformed RustfsGoErrorCode = "AuthorizationHeaderMalformed" // 服务器 ErrCodeInternalError RustfsGoErrorCode = "InternalError" ErrCodeSlowDown RustfsGoErrorCode = "SlowDown" ErrCodeNotImplemented RustfsGoErrorCode = "NotImplemented" // 条件请求 ErrCodePreconditionFailed RustfsGoErrorCode = "PreconditionFailed" ErrCodeNotModified RustfsGoErrorCode = "NotModified" // 复制 ErrCodeInvalidCopySource RustfsGoErrorCode = "InvalidCopySource" )
S3 标准错误码
Click to show internal directories.
Click to hide internal directories.