viewerror

package
v0.10.3-0...-dc27231 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachRPCContext

func AttachRPCContext(err error, info *viewpb.RPCRequestContext) error

AttachRPCContext adds structured gRPC details without replacing the original error chain: readiness, session discovery and cancellation still inspect it. WithDetails serializes a snapshot, so later changes to info cannot affect err.

func ConvertViewError

func ConvertViewError(method string, err error) error

ConvertViewError converts error to ViewClientStatus. Used in client side.

func NewGRPCStatusFromError

func NewGRPCStatusFromError(err error) *status.Status

NewGRPCStatusFromError preserves business error codes as native gRPC details. View lifecycle errors keep their retry protocol. For business errors, common.Status carries the code/classification and ViewError carries the cause rendered by ViewClientStatus.Error.

func NewGRPCStatusFromViewError

func NewGRPCStatusFromViewError(e *ViewError) *status.Status

NewGRPCStatusFromViewError converts ViewError to grpc status. Should be called at server-side.

func RPCContextFromDetails

func RPCContextFromDetails(details []any) *viewpb.RPCRequestContext

RPCContextFromDetails uses the last matching detail: the local client's actual target takes precedence over context supplied by a remote peer.

Types

type NodeSessionUnavailable

type NodeSessionUnavailable struct {
	Cause   error
	Changed <-chan struct{}
}

NodeSessionUnavailable is client-local metadata, never a wire error. Changed belongs to the QN session watch captured before dispatch, so a resolver update racing with an RPC failure cannot be missed. Unwrap preserves the RPC cause.

func (*NodeSessionUnavailable) Error

func (e *NodeSessionUnavailable) Error() string

func (*NodeSessionUnavailable) Unwrap

func (e *NodeSessionUnavailable) Unwrap() error

type ViewClientStatus

type ViewClientStatus struct {
	*status.Status
	// contains filtered or unexported fields
}

ViewClientStatus is a wrapper of grpc status. Should be used in client side.

func (*ViewClientStatus) Error

func (s *ViewClientStatus) Error() string

Error implements error.

func (*ViewClientStatus) GRPCStatus

func (s *ViewClientStatus) GRPCStatus() *status.Status

GRPCStatus returns the underlying gRPC status.

func (*ViewClientStatus) TryIntoViewError

func (s *ViewClientStatus) TryIntoViewError() *ViewError

TryIntoViewError tries to extract a ViewError from the gRPC status details.

func (*ViewClientStatus) Unwrap

func (s *ViewClientStatus) Unwrap() error

Unwrap exposes the original Milvus code to the Proxy's public status mapping without discarding the view protocol used by query retries.

type ViewCode

type ViewCode viewpb.ViewCode

ViewError is the error type for view-related operations. Should be used at logic layer.

type ViewError

type ViewError ViewErrorInner

ViewError is the error type for view-related operations. Should be used at logic layer.

func AsViewError

func AsViewError(err error) *ViewError

AsViewError converts an error to a ViewError. If the error is already a ViewError, returns it directly. Otherwise wraps it as VIEW_CODE_UNKNOWN.

func New

func New(code viewpb.ViewCode, format string, args ...interface{}) *ViewError

New creates a new ViewError with the given code and cause.

func NewNotPrimaryError

func NewNotPrimaryError(format string, args ...interface{}) *ViewError

NewNotPrimaryError creates a ViewError with VIEW_CODE_NOT_PRIMARY.

func NewOnShutdownError

func NewOnShutdownError(format string, args ...interface{}) *ViewError

NewOnShutdownError creates a ViewError with VIEW_CODE_ON_SHUTDOWN.

func NewUnknownError

func NewUnknownError(format string, args ...interface{}) *ViewError

NewUnknownError creates a ViewError with VIEW_CODE_UNKNOWN.

func NewViewInvalidated

func NewViewInvalidated(format string, args ...interface{}) *ViewError

NewViewInvalidated creates a ViewError with VIEW_CODE_VIEW_INVALIDATED.

func NewViewNotFound

func NewViewNotFound(format string, args ...interface{}) *ViewError

NewViewNotFound creates a ViewError with VIEW_CODE_VIEW_NOT_FOUND.

func (*ViewError) AsPBError

func (e *ViewError) AsPBError() *viewpb.ViewError

AsPBError converts ViewError to viewpb.ViewError.

func (*ViewError) Error

func (e *ViewError) Error() string

Error implements error.

func (*ViewError) IsNotPrimary

func (e *ViewError) IsNotPrimary() bool

IsNotPrimary returns true if the node is not the primary replica for this shard.

func (*ViewError) IsOnShutdown

func (e *ViewError) IsOnShutdown() bool

IsOnShutdown returns true if the node is shutting down.

func (*ViewError) IsRetryable

func (e *ViewError) IsRetryable() bool

IsRetryable returns true if the error should trigger a retry from Phase 1.

func (*ViewError) IsViewInvalidated

func (e *ViewError) IsViewInvalidated() bool

IsViewInvalidated returns true if the view version is no longer valid.

func (*ViewError) IsViewNotFound

func (e *ViewError) IsViewNotFound() bool

IsViewNotFound returns true if the view version was not found on the node.

type ViewErrorInner

type ViewErrorInner = viewpb.ViewError

ViewErrorInner is the underlying type aliased from proto.

Jump to

Keyboard shortcuts

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