Documentation
¶
Index ¶
- Variables
- func Base(format string, a ...any) error
- func DetectErrorType(errorMsg string) error
- func Err(err any, fmtParams ...any) error
- func FullTrace(err error) string
- func HasTrace(err error) bool
- func Is(e error, target error) bool
- func IsBlobNotFoundError(err error) bool
- func IsEndOfListError(err error) bool
- func IsKnownErrorType(err error) bool
- func Prefix(prefix string, err any) error
- func Trace(err error) string
- func Unwrap(err error) error
- func Wrap(err any, skip int) *goerrors.Error
Constants ¶
This section is empty.
Variables ¶
var ( ErrBlobNotFound = errors.New("blob not found") ErrBlobExists = errors.New("blob already exists on server") ErrInvalidHash = errors.New("invalid hash") ErrInvalidSize = errors.New("invalid size") ErrStreamCorrupted = errors.New("stream corrupted") ErrAccessDenied = errors.New("access denied") ErrInvalidManifest = errors.New("invalid manifest") ErrHashMismatch = errors.New("hash mismatch") ErrConnectionFailed = errors.New("connection failed") ErrTimeout = errors.New("operation timeout") ErrInvalidConfig = errors.New("invalid configuration") ErrRequestTooLarge = errors.New("request is too large") ErrInvalidData = errors.New("Invalid data") ErrInvalidHashLen = errors.New("Invalid blob hash length") ErrBlobProtected = errors.New("requested blob is protected") ErrNoBlobData = errors.New("no blob data received") ErrAlreadyConnected = errors.New("already connected") ErrServerValidation = errors.New("server validation error") ErrAcquisitionFailed = errors.New("failed to acquire blob from all transfer methods") ErrInvalidOffset = errors.New("offset must be non-negative") ErrInvalidLimit = errors.New("limit must be positive") ErrEndOfList = errors.New("end of list reached") )
Common errors
var ( ErrFailedToCheckBlobExistence = errors.New("failed to check blob existence") ErrFailedToCheckNeededBlobs = errors.New("failed to check needed blobs") )
Storage operation errors
var ( ErrFailedToParsePeerAddress = errors.New("failed to parse peer address") ErrFailedToStoreBlob = errors.New("failed to store blob") ErrFailedToMarshalBlobResponse = errors.New("failed to marshal blob response") ErrFailedToMarshalTransferResponse = errors.New("failed to marshal transfer response") ErrFailedToSetReadDeadline = errors.New("failed to set read deadline") ErrFailedToReadBlobData = errors.New("failed to read blob data") ErrFailedToDecodeJSON = errors.New("failed to decode JSON") ErrFailedToMarshalJSON = errors.New("failed to marshal JSON") ErrFailedToSetWriteDeadline = errors.New("failed to set write deadline") ErrFailedToWriteData = errors.New("failed to write data") )
Network and I/O operation errors
var ( ErrBlobTooBig = errors.New("blob must be at most 2097152 bytes") ErrBlobEmpty = errors.New("blob is empty") ErrInvalidIV = errors.New("IV length must equal to block size") ErrInvalidBlockLength = errors.New("invalid block length") ErrInvalidDataLength = errors.New("invalid data length") ErrInvalidPadding = errors.New("invalid padding") ErrStreamTooShort = errors.New("stream must be at least 2 blobs long") ErrInvalidSDBlob = errors.New("sd blob is not valid") ErrMissingTerminatingBlob = errors.New("sd blob is missing the terminating 0-length blob") ErrBlobCountMismatch = errors.New("number of blobs in stream does not match number of blobs in sd info") ErrUnexpectedEmptyBlob = errors.New("got 0-length blob before end of stream") ErrBlobsOutOfOrder = errors.New("blobs are out of order in sd blob") )
Stream-specific errors (added from lbry.go)
var (
ErrTransferStopped = errors.New("transfer is stopped")
)
Functions ¶
func DetectErrorType ¶
DetectErrorType detects specific error types by string matching since errors come from different process
func Err ¶
Err intelligently creates/handles errors, while preserving the stack trace. It works with errors from github.com/pkg/errors too.
func Is ¶
Is reports whether any error in e's chain matches target. It fully unwraps both errors (handling both causer and go-errors.Error types) before delegating to stdlib errors.Is for the final comparison.
func IsBlobNotFoundError ¶
IsBlobNotFoundError checks if an error represents a blob not found condition It checks both for the exact error object and string containment
func IsEndOfListError ¶
IsEndOfListError checks if an error represents an end-of-list condition
func IsKnownErrorType ¶
IsKnownErrorType checks if an error is a known protocol error that shouldn't be wrapped
Types ¶
This section is empty.