errors

package
v1.4.3-prerelease03 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrFakeServiceBusy is a fake service busy error.
	ErrFakeServiceBusy = &types.ServiceBusyError{Message: "Fake Service Busy Error."}
	// ErrFakeInternalService is a fake internal service error.
	ErrFakeInternalService = &types.InternalServiceError{Message: "Fake Internal Service Error."}
	// ErrFakeTimeout is a fake timeout error.
	ErrFakeTimeout = context.DeadlineExceeded
	// ErrFakeUnhandled is a fake unhandled error.
	ErrFakeUnhandled = errors.New("fake unhandled error")
)

Functions

func ExtractPeerHostname added in v1.3.1

func ExtractPeerHostname(err error) (string, error)

ExtractPeerHostname extracts the peer hostname from a wrapped error Returns the hostname and the original unwrapped error

func GenerateFakeError added in v0.18.0

func GenerateFakeError(
	errorRate float64,
) error

GenerateFakeError generates a random fake error

func NewPeerHostnameError added in v1.3.1

func NewPeerHostnameError(err error, peer string) error

NewPeerHostnameError creates a new PeerHostnameError

func ShouldForwardCall added in v0.18.0

func ShouldForwardCall(
	err error,
) bool

ShouldForwardCall determines if the call should be forward to the underlying client given the fake error generated

Types

type InternalFailureError added in v0.4.0

type InternalFailureError struct {
	Msg string
}

InternalFailureError represents unexpected case happening or a code bug

func NewInternalFailureError added in v0.4.0

func NewInternalFailureError(msg string) *InternalFailureError

NewInternalFailureError return internal failure error

func (*InternalFailureError) Error added in v0.4.0

func (e *InternalFailureError) Error() string

type PeerHostnameError added in v1.3.1

type PeerHostnameError struct {
	PeerHostname string
	WrappedError error
}

PeerHostnameError wraps an error with peer hostname information

func (*PeerHostnameError) Error added in v1.3.1

func (e *PeerHostnameError) Error() string

Error implements the error interface

func (*PeerHostnameError) Unwrap added in v1.3.1

func (e *PeerHostnameError) Unwrap() error

Unwrap implements the error unwrapping interface

type SemaphoreNotOwnedByHostError

type SemaphoreNotOwnedByHostError struct {
	OwnedByIdentity string
	MyIdentity      string
	// BucketID names the bucket in full, as "<domainID>/<semaphoreName>/<bucket>".
	BucketID string
}

SemaphoreNotOwnedByHostError says the ring puts this bucket on another host. The caller should go to OwnedByIdentity rather than wait, since nothing about this host will change.

func NewSemaphoreNotOwnedByHostError

func NewSemaphoreNotOwnedByHostError(ownedByIdentity string, myIdentity string, bucketID string) *SemaphoreNotOwnedByHostError

func (*SemaphoreNotOwnedByHostError) Error

type TaskListNotOwnedByHostError added in v1.2.13

type TaskListNotOwnedByHostError struct {
	OwnedByIdentity string
	MyIdentity      string
	TasklistName    string
}

func NewTaskListNotOwnedByHostError added in v1.2.13

func NewTaskListNotOwnedByHostError(ownedByIdentity string, myIdentity string, tasklistName string) *TaskListNotOwnedByHostError

func (*TaskListNotOwnedByHostError) Error added in v1.2.13

Jump to

Keyboard shortcuts

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