dterrors

package
v0.0.0-rc3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckErrorWrapping

func CheckErrorWrapping(t *testing.T, comment string,
	predicate func(error) bool,
	newError func(error) error)

CheckErrorWrapping checks that your custom error wrapper will not be damaged by other wrappers and vice vera. Use this function to run sub-test for your custom errors like this:

CheckErrorWrapping(t, "default creation", IsFatal, NewFatalError)

Parameters:

comment:   comment for your sub-test
isOpaque:  if true, error removes type information about underlying error or does not using underlying error at all
predicate: function determines is some error matches your error, e.g. IsFatal(err)
newError:  error constructor (wrapper), at least check default error constructor

func CheckOpaqueErrorWrapping

func CheckOpaqueErrorWrapping(t *testing.T, comment string,
	predicate func(error) bool,
	newError func(error) error)

CheckOpaqueErrorWrapping is the same as CheckErrorWrapping, but for opaque errors can be used for checking new errors as well

func IsFatal

func IsFatal(err error) bool

func IsNonShardableError

func IsNonShardableError(err error) bool

func IsRetriablePartUploadError

func IsRetriablePartUploadError(err error) bool

func IsTableUploadError

func IsTableUploadError(err error) bool

func NewFatalError

func NewFatalError(err error) error

func NewNonShardableError

func NewNonShardableError(err error) error

func NewTableUploadError

func NewTableUploadError(err error) error

Types

type FatalError

type FatalError interface {
	error
	IsFatal()
}

FatalError denotes an error which must stop the transfer completely, forbidding to restart it automatically

type NonShardableError

type NonShardableError interface {
	error
	IsNonShardableError()
}

type RetriablePartUploadError

type RetriablePartUploadError struct {
	// contains filtered or unexported fields
}

func NewRetriablePartUploadError

func NewRetriablePartUploadError(err error) *RetriablePartUploadError

func (*RetriablePartUploadError) Is

func (e *RetriablePartUploadError) Is(err error) bool

func (*RetriablePartUploadError) Unwrap

func (e *RetriablePartUploadError) Unwrap() error

type TableUploadError

type TableUploadError struct {
	// contains filtered or unexported fields
}

func (TableUploadError) Is

func (p TableUploadError) Is(err error) bool

func (TableUploadError) Unwrap

func (p TableUploadError) Unwrap() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL