Documentation ¶
Index ¶
- Constants
- Variables
- func Cause(err error) error
- func ErrCode(err error) string
- func IsChallengesUnsupportedErr(err error) bool
- func IsConflictErr(err error) bool
- func IsErr(err error, code string) bool
- func IsNotFoundErr(err error) bool
- func IsRateLimitError(err error) bool
- type Error
- func BadRequestError(err error) *Error
- func ConflictError(err error) *Error
- func DeniedError(err error) *Error
- func Errorf(format string, args ...interface{}) *Error
- func ForbiddenError(err error) *Error
- func MethodNotAllowedError(err error) *Error
- func New(in interface{}) *Error
- func NotFoundError(err error) *Error
- func PreconditionFailedError(err error) *Error
- func UnauthorizedError(err error) *Error
- func UnknownError(err error) *Error
- func Wrap(err error, message string) *Error
- func Wrapf(err error, format string, args ...interface{}) *Error
- func (e *Error) Error() string
- func (e *Error) MarshalJSON() ([]byte, error)
- func (e *Error) StackTrace() string
- func (e *Error) Unwrap() error
- func (e *Error) WithCause(err error) *Error
- func (e *Error) WithCode(code string) *Error
- func (e *Error) WithMessage(message string) *Error
- func (e *Error) WithMessagef(format string, v ...interface{}) *Error
- type Errors
- type StackFrames
Constants ¶
const ( // NotFoundCode is code for the error of no object found NotFoundCode = "NOT_FOUND" // ConflictCode ... ConflictCode = "CONFLICT" // UnAuthorizedCode ... UnAuthorizedCode = "UNAUTHORIZED" // BadRequestCode ... BadRequestCode = "BAD_REQUEST" // ForbiddenCode ... ForbiddenCode = "FORBIDDEN" // MethodNotAllowedCode ... MethodNotAllowedCode = "METHOD_NOT_ALLOWED" // RateLimitCode RateLimitCode = "TOO_MANY_REQUEST" // PreconditionCode ... PreconditionCode = "PRECONDITION" // GeneralCode ... GeneralCode = "UNKNOWN" // ChallengesUnsupportedCode ... ChallengesUnsupportedCode = "ChallengesUnsupportedCode" // DENIED it's used by middleware(readonly, vul and content trust) and returned to docker client to index the request is denied. DENIED = "DENIED" // PROJECTPOLICYVIOLATION ... PROJECTPOLICYVIOLATION = "PROJECTPOLICYVIOLATION" // ViolateForeignKeyConstraintCode is the error code for violating foreign key constraint error ViolateForeignKeyConstraintCode = "VIOLATE_FOREIGN_KEY_CONSTRAINT" // DIGESTINVALID ... DIGESTINVALID = "DIGEST_INVALID" // MANIFESTINVALID ... MANIFESTINVALID = "MANIFEST_INVALID" // UNSUPPORTED is for digest UNSUPPORTED error UNSUPPORTED = "UNSUPPORTED" )
Variables ¶
var ( // As alias function of `errors.As` As = errors.As // Is alias function of `errors.Is` Is = errors.Is )
Functions ¶
func IsConflictErr ¶
IsConflictErr checks whether the err chain contains conflict error
func IsNotFoundErr ¶
IsNotFoundErr returns true when the error is NotFoundError
func IsRateLimitError ¶
IsRateLimitError checks whether the err chains contains rate limit error
Types ¶
type Error ¶
type Error struct { Cause error `json:"-"` Code string `json:"code"` Message string `json:"message"` Stack *stack `json:"-"` }
Error ...
func BadRequestError ¶
BadRequestError is error for the case of bad request
func ConflictError ¶
ConflictError is error for the case of object conflict
func ForbiddenError ¶
ForbiddenError is error for the case of forbidden
func MethodNotAllowedError ¶
MethodNotAllowedError is error for the case of forbidden
func NotFoundError ¶
NotFoundError is error for the case of object not found
func PreconditionFailedError ¶
PreconditionFailedError is error for the case of precondition failed
func UnauthorizedError ¶
UnauthorizedError is error for the case of unauthorized accessing
func (*Error) Error ¶
Error returns a human readable error, error.Error() will not contains the track information. Needs it? just call error.StackTrace() Code will not be in the error output.
func (*Error) WithMessagef ¶
WithMessagef ...
type StackFrames ¶
StackFrames ... ToDo we can define an Harbor frame to customize trace message, but it depends on requirement