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 ExitStatus(err error) int
- 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 IsPointerScanError(err error) bool
- func IsProtocolError(err error) bool
- func IsRetriableError(err error) bool
- func IsRetriableLaterError(err error) (time.Time, bool)
- func IsSmudgeError(err error) bool
- func IsUnprocessableEntityError(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 NewPointerScanError(err error, treeishOid, path string) error
- func NewProtocolError(message string, err error) error
- func NewRetriableError(err error) error
- func NewRetriableLaterError(err error, header string) error
- func NewSmudgeError(err error, oid, filename string) error
- func NewUnprocessableEntityError(err error) 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
- type PointerScanError
- func (e PointerScanError) Context() map[string]interface{}
- func (e PointerScanError) Del(key string)
- func (e PointerScanError) Get(key string) interface{}
- func (e PointerScanError) OID() string
- func (e PointerScanError) Path() string
- func (e PointerScanError) PointerScanError() bool
- func (e PointerScanError) Set(key string, val interface{})
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 ExitStatus ¶ added in v3.1.0
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 IsPointerScanError ¶
IsNotAPointerError indicates the parsed data is not an LFS pointer.
func IsProtocolError ¶
IsProtocolError indicates that the SSH pkt-line protocol data is invalid.
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 IsUnprocessableEntityError ¶
IsDownloadDeclinedError indicates that the upload operation failed because of an HTTP 422 response code.
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 NewPointerScanError ¶
func NewProtocolError ¶
func NewRetriableError ¶
func NewRetriableLaterError ¶
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 ¶
type PointerScanError ¶
type PointerScanError struct {
// contains filtered or unexported fields
}
func (PointerScanError) Context ¶
func (e PointerScanError) Context() map[string]interface{}
Context returns the underlying context.
func (PointerScanError) Del ¶
func (e PointerScanError) Del(key string)
Del removes a key from the context.
func (PointerScanError) Get ¶
func (e PointerScanError) Get(key string) interface{}
Get gets the value for a key in the context.
func (PointerScanError) OID ¶
func (e PointerScanError) OID() string
func (PointerScanError) Path ¶
func (e PointerScanError) Path() string
func (PointerScanError) PointerScanError ¶
func (e PointerScanError) PointerScanError() bool