merr

package
v0.0.0-...-1593278 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Index

Constants

View Source
const (
	CanceledCode int32 = 10000
	TimeoutCode  int32 = 10001
)

Variables

View Source
var (
	// Service related
	ErrServiceNotReady             = newMilvusError("service not ready", 1, true) // This indicates the service is still in init
	ErrServiceUnavailable          = newMilvusError("service unavailable", 2, true)
	ErrServiceMemoryLimitExceeded  = newMilvusError("memory limit exceeded", 3, false)
	ErrServiceRequestLimitExceeded = newMilvusError("request limit exceeded", 4, true)
	ErrServiceInternal             = newMilvusError("service internal error", 5, false) // Never return this error out of Milvus

	// Collection related
	ErrCollectionNotFound         = newMilvusError("collection not found", 100, false)
	ErrCollectionNotLoaded        = newMilvusError("collection not loaded", 101, false)
	ErrCollectionNumLimitExceeded = newMilvusError("exceeded the limit number of collections", 102, false)

	// Partition related
	ErrPartitionNotFound  = newMilvusError("partition not found", 202, false)
	ErrPartitionNotLoaded = newMilvusError("partition not loaded", 203, false)

	// ResourceGroup related
	ErrResourceGroupNotFound = newMilvusError("resource group not found", 300, false)

	// Replica related
	ErrReplicaNotFound          = newMilvusError("replica not found", 400, false)
	ErrNoAvailableNodeInReplica = newMilvusError("no available node in replica", 401, false)

	// Channel related
	ErrChannelNotFound    = newMilvusError("channel not found", 500, false)
	ErrChannelLack        = newMilvusError("channel lacks", 501, false)
	ErrChannelReduplicate = newMilvusError("channel reduplicates", 502, false)

	// Segment related
	ErrSegmentNotFound    = newMilvusError("segment not found", 600, false)
	ErrSegmentNotLoaded   = newMilvusError("segment not loaded", 601, false)
	ErrSegmentLack        = newMilvusError("segment lacks", 602, false)
	ErrSegmentReduplicate = newMilvusError("segment reduplicates", 603, false)

	// Index related
	ErrIndexNotFound = newMilvusError("index not found", 700, false)

	// Node related
	ErrNodeNotFound = newMilvusError("node not found", 901, false)
	ErrNodeOffline  = newMilvusError("node offline", 902, false)
	ErrNodeLack     = newMilvusError("node lacks", 903, false)
	ErrNodeNotMatch = newMilvusError("node not match", 904, false)

	// IO related
	ErrIoKeyNotFound = newMilvusError("key not found", 1000, false)
	ErrIoFailed      = newMilvusError("IO failed", 1001, false)

	// Parameter related
	ErrParameterInvalid = newMilvusError("invalid parameter", 1100, false)

	// Metrics related
	ErrMetricNotFound = newMilvusError("metric not found", 1200, false)

	// Topic related
	ErrTopicNotFound = newMilvusError("topic not found", 1300, false)
	ErrTopicNotEmpty = newMilvusError("topic not empty", 1301, false)

	// Average related
	ErrAverageLabelNotRegister = newMilvusError("average label not register", 1400, false)

	// shard delegator related
	ErrShardDelegatorNotFound = newMilvusError("shard delegator not found", 1500, false)

	// task related
	ErrTaskQueueFull = newMilvusError("task queue full", 1600, false)
)

Define leaf errors here, WARN: take care to add new error, check whehter you can use the erorrs below before adding a new one. Name: Err + related prefix + error name

Functions

func CheckHealthy

func CheckHealthy(state commonpb.StateCode) error

CheckHealthy checks whether the state is healthy, returns nil if healthy, otherwise returns ErrServiceNotReady wrapped with current state

func Code

func Code(err error) int32

Code returns the error code of the given error, WARN: DO NOT use this for now

func Combine

func Combine(errs ...error) error

func Error

func Error(status *commonpb.Status) error

Error returns a error according to the given status, returns nil if the status is a success status

func IsRetriable

func IsRetriable(err error) bool

func Ok

func Ok(status *commonpb.Status) bool

func Status

func Status(err error) *commonpb.Status

Status returns a status according to the given err, returns Success status if err is nil

func WrapErrAverageLabelNotRegister

func WrapErrAverageLabelNotRegister(label string, msg ...string) error

Average related

func WrapErrChannelLack

func WrapErrChannelLack(name string, msg ...string) error

func WrapErrChannelNotFound

func WrapErrChannelNotFound(name string, msg ...string) error

Channel related

func WrapErrChannelReduplicate

func WrapErrChannelReduplicate(name string, msg ...string) error

func WrapErrCollectionNotFound

func WrapErrCollectionNotFound(collection any, msg ...string) error

Collection related

func WrapErrCollectionNotLoaded

func WrapErrCollectionNotLoaded(collection any, msg ...string) error

func WrapErrCollectionResourceLimitExceeded

func WrapErrCollectionResourceLimitExceeded(msg ...string) error

func WrapErrIndexNotFound

func WrapErrIndexNotFound(msg ...string) error

Index related

func WrapErrIoFailed

func WrapErrIoFailed(key string, msg ...string) error

func WrapErrIoKeyNotFound

func WrapErrIoKeyNotFound(key string, msg ...string) error

IO related

func WrapErrMetricNotFound

func WrapErrMetricNotFound(name string, msg ...string) error

Metrics related

func WrapErrNoAvailableNodeInReplica

func WrapErrNoAvailableNodeInReplica(id int64, msg ...string) error

func WrapErrNodeLack

func WrapErrNodeLack(expectedNum, actualNum int64, msg ...string) error

func WrapErrNodeNotFound

func WrapErrNodeNotFound(id int64, msg ...string) error

Node related

func WrapErrNodeNotMatch

func WrapErrNodeNotMatch(expectedNodeID, actualNodeID int64, msg ...string) error

func WrapErrNodeOffline

func WrapErrNodeOffline(id int64, msg ...string) error

func WrapErrParameterDuplicateFieldData

func WrapErrParameterDuplicateFieldData(fieldName string, msg ...string) error

func WrapErrParameterInvalid

func WrapErrParameterInvalid[T any](expected, actual T, msg ...string) error

Parameter related

func WrapErrParameterInvalidRange

func WrapErrParameterInvalidRange[T any](lower, upper, actual T, msg ...string) error

func WrapErrPartitionNotFound

func WrapErrPartitionNotFound(partition any, msg ...string) error

Partition related

func WrapErrPartitionNotLoaded

func WrapErrPartitionNotLoaded(partition any, msg ...string) error

func WrapErrReplicaNotFound

func WrapErrReplicaNotFound(id int64, msg ...string) error

Replica related

func WrapErrResourceGroupNotFound

func WrapErrResourceGroupNotFound(rg any, msg ...string) error

ResourceGroup related

func WrapErrSegmentLack

func WrapErrSegmentLack(id int64, msg ...string) error

func WrapErrSegmentNotFound

func WrapErrSegmentNotFound(id int64, msg ...string) error

Segment related

func WrapErrSegmentNotLoaded

func WrapErrSegmentNotLoaded(id int64, msg ...string) error

func WrapErrSegmentReduplicate

func WrapErrSegmentReduplicate(id int64, msg ...string) error

func WrapErrServiceInternal

func WrapErrServiceInternal(msg string, others ...string) error

func WrapErrServiceMemoryLimitExceeded

func WrapErrServiceMemoryLimitExceeded(predict, limit float32, msg ...string) error

func WrapErrServiceNotReady

func WrapErrServiceNotReady(stage string, msg ...string) error

Service related

func WrapErrServiceRequestLimitExceeded

func WrapErrServiceRequestLimitExceeded(limit int32, msg ...string) error

func WrapErrServiceUnavailable

func WrapErrServiceUnavailable(reason string, msg ...string) error

func WrapErrShardDelegatorNotFound

func WrapErrShardDelegatorNotFound(channel string, msg ...string) error

shard delegator related

func WrapErrTaskQueueFull

func WrapErrTaskQueueFull(msg ...string) error

task related

func WrapErrTopicNotEmpty

func WrapErrTopicNotEmpty(name string, msg ...string) error

func WrapErrTopicNotFound

func WrapErrTopicNotFound(name string, msg ...string) error

Topic related

Types

This section is empty.

Jump to

Keyboard shortcuts

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