Documentation ¶
Overview ¶
Package errutil provides common error handling tools NOTE: Subject to change, do not rely on this package from outside git-lfs source
Index ¶
- func Error(err error) error
- func ErrorContext(err error) map[string]interface{}
- func ErrorDelContext(err error, key string)
- func ErrorGetContext(err error, key string) interface{}
- func ErrorSetContext(err error, key string, value interface{})
- func ErrorStack(err error) []byte
- func Errorf(err error, format string, args ...interface{}) error
- func GetInnerError(err error) error
- 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 IsInvalidPointerError(err error) bool
- func IsInvalidRepoError(err error) bool
- func IsNotAPointerError(err error) bool
- func IsNotImplementedError(err error) bool
- func IsRetriableError(err error) bool
- func IsSmudgeError(err error) bool
- func NewAuthError(err error) error
- func NewBadPointerKeyError(expected, actual string) error
- func NewCleanPointerError(err error, pointer interface{}, bytes []byte) error
- func NewDownloadDeclinedError(err error) error
- func NewFatalError(err error) error
- func NewInvalidPointerError(err error) error
- func NewInvalidRepoError(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 Stack() []byte
- func StandardizeBadPointerError(err error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorContext ¶
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 ErrorDelContext ¶
ErrorDelContext removes a value from the error's context. If the error has not been wrapped, it does nothing.
func ErrorGetContext ¶
ErrorGetContext gets a value from the error's context. If the error has not been wrapped, it returns an empty string.
func ErrorSetContext ¶
ErrorSetContext sets a value in the error's context. If the error has not been wrapped, it does nothing.
func ErrorStack ¶
ErrorStack returns the stack for an error if it is a wrappedError. If it is not a wrappedError it will return an empty byte slice.
func GetInnerError ¶
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 IsInvalidPointerError ¶
IsInvalidPointerError indicates an attempt to parse data that was not a valid pointer.
func IsInvalidRepoError ¶
IsInvalidRepoError indicates an operation was attempted from outside a git repository.
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 NewAuthError ¶
func NewBadPointerKeyError ¶
func NewCleanPointerError ¶
func NewFatalError ¶
func NewInvalidPointerError ¶
func NewInvalidRepoError ¶
func NewNotAPointerError ¶
func NewNotImplementedError ¶
func NewRetriableError ¶
func NewSmudgeError ¶
func StandardizeBadPointerError ¶
If an error is abad pointer error of any type, returns NotAPointerError
Types ¶
This section is empty.