errors

package
v0.1.0-beta-3 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSystemError represents the error is a system error.
	ErrSystemError = errors.New("system error")

	// ErrTaskDownloadFail represents an exception was encountered while downloading the file
	ErrTaskDownloadFail = errors.New("resource download failed")

	// ErrDataNotFound represents the data cannot be found.
	ErrDataNotFound = errors.New("data not found")

	// ErrInvalidValue represents the value is invalid.
	ErrInvalidValue = errors.New("invalid value")

	// ErrConvertFailed represents failed to convert.
	ErrConvertFailed = errors.New("convert failed")
)

Functions

func IsConvertFailed

func IsConvertFailed(err error) bool

func IsDataNotFound

func IsDataNotFound(err error) bool

func IsDownloadFail

func IsDownloadFail(err error) bool

func IsFileNotExist

func IsFileNotExist(err error) bool

func IsInconsistentValues

func IsInconsistentValues(err error) bool

func IsInvalidValue

func IsInvalidValue(err error) bool

func IsResourceExpired

func IsResourceExpired(err error) bool

func IsResourceNotSupportRangeRequest

func IsResourceNotSupportRangeRequest(err error) bool

func IsSystemError

func IsSystemError(err error) bool

IsSystemError checks the error is a system error or not.

func IsTaskIDDuplicate

func IsTaskIDDuplicate(err error) bool

IsTaskIDDuplicate checks the error is a TaskIDDuplicate error or not.

func IsURLNotReachable

func IsURLNotReachable(err error) bool

IsURLNotReachable checks the error is a url not reachable or not.

Types

type ErrFileNotExist

type ErrFileNotExist struct {
	File string
}

ErrFileNotExist represents the file is not exists

func (ErrFileNotExist) Error

func (e ErrFileNotExist) Error() string

type ErrInconsistentValues

type ErrInconsistentValues struct {
	Expected interface{}
	Actual   interface{}
}

func (ErrInconsistentValues) Error

func (e ErrInconsistentValues) Error() string

type ErrResourceExpired

type ErrResourceExpired struct {
	URL string
}

ErrResourceExpired represents the downloaded resource has expired

func (ErrResourceExpired) Error

func (e ErrResourceExpired) Error() string

type ErrResourceNotSupportRangeRequest

type ErrResourceNotSupportRangeRequest struct {
	URL string
}

ErrResourceNotSupportRangeRequest represents the downloaded resource does not support Range downloads

func (ErrResourceNotSupportRangeRequest) Error

type ErrTaskIDDuplicate

type ErrTaskIDDuplicate struct {
	TaskID string
	Cause  error
}

ErrTaskIDDuplicate represents the task id is in conflict.

func (ErrTaskIDDuplicate) Error

func (e ErrTaskIDDuplicate) Error() string

type ErrURLNotReachable

type ErrURLNotReachable struct {
	URL string
}

ErrURLNotReachable represents the url is a not reachable.

func (ErrURLNotReachable) Error

func (e ErrURLNotReachable) Error() string

Jump to

Keyboard shortcuts

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