Documentation ¶
Overview ¶
Package errors provides common error handling tools NOTE: Subject to change, do not rely on this package from outside git-lfs source
Index ¶
- func Cause(err error) error
- func Combine(errs []error) error
- func Context(err error) map[string]interface{}
- func DelContext(err error, key string)
- func Errorf(format string, args ...interface{}) error
- func GetContext(err error, key string) interface{}
- func IsAuthError(err error) bool
- func IsBadPointerKeyError(err error) bool
- func IsCleanPointerError(err error) bool
- func IsDownloadDeclinedError(err error) bool
- func IsFatalError(err error) bool
- func IsNotAPointerError(err error) bool
- func IsNotImplementedError(err error) bool
- func IsRetriableError(err error) bool
- func IsSmudgeError(err error) bool
- func New(message string) error
- func NewAuthError(err error) error
- func NewBadPointerKeyError(expected, actual string) error
- func NewCleanPointerError(pointer interface{}, bytes []byte) error
- func NewDownloadDeclinedError(err error, msg string) error
- func NewFatalError(err error) error
- func NewNotAPointerError(err error) error
- func NewNotImplementedError(err error) error
- func NewRetriableError(err error) error
- func NewSmudgeError(err error, oid, filename string) error
- func SetContext(err error, key string, value interface{})
- func StackTrace(err error) []string
- func StandardizeBadPointerError(err error) error
- func Wrap(err error, msg string) error
- func Wrapf(err error, format string, args ...interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Context ¶
ErrorContext returns the context map for an error if it is a wrappedError. If it is not a wrappedError it will return an empty map.
func DelContext ¶
ErrorDelContext removes a value from the error's context. If the error has not been wrapped, it does nothing.
func Errorf ¶
Errorf formats according to a format specifier and returns the string as a value that satisfies error. Errorf also records the stack trace at the point it was called.
func GetContext ¶
ErrorGetContext gets a value from the error's context. If the error has not been wrapped, it returns an empty string.
func IsAuthError ¶
IsAuthError indicates the client provided a request with invalid or no authentication credentials when credentials are required (e.g. HTTP 401).
func IsBadPointerKeyError ¶
IsBadPointerKeyError indicates that the parsed data has an invalid key.
func IsCleanPointerError ¶
IsCleanPointerError indicates an error while cleaning a file.
func IsDownloadDeclinedError ¶
IsDownloadDeclinedError indicates that the smudge operation should not download. TODO: I don't really like using errors to control that flow, it should be refactored.
func IsFatalError ¶
IsFatalError indicates that the error is fatal and the process should exit immediately after handling the error.
func IsNotAPointerError ¶
IsNotAPointerError indicates the parsed data is not an LFS pointer.
func IsNotImplementedError ¶
IsNotImplementedError indicates the client attempted to use a feature the server has not implemented (e.g. the batch endpoint).
func IsRetriableError ¶
IsRetriableError indicates the low level transfer had an error but the caller may retry the operation.
func IsSmudgeError ¶
IsSmudgeError indicates an error while smudging a files.
func New ¶
New returns an error with the supplied message. New also records the stack trace at thepoint it was called.
func NewAuthError ¶
func NewBadPointerKeyError ¶
func NewCleanPointerError ¶
func NewFatalError ¶
func NewNotAPointerError ¶
func NewNotImplementedError ¶
func NewRetriableError ¶
func NewSmudgeError ¶
func SetContext ¶
ErrorSetContext sets a value in the error's context. If the error has not been wrapped, it does nothing.
func StackTrace ¶
func StandardizeBadPointerError ¶
If an error is abad pointer error of any type, returns NotAPointerError
Types ¶
This section is empty.