cherryError

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2026 License: MIT Imports: 2 Imported by: 28

Documentation

Overview

Package cherryError provides lightweight error constructors and sentinel errors used throughout the Cherry framework.

Constructors:

  • Error / Errorf — create a new error
  • Wrap / Wrapf — wrap an existing error with context

Sentinel errors are grouped by subsystem:

  • route, packet, message, protobuf, cluster, discovery, actor, func

Index

Constants

This section is empty.

Variables

View Source
var (
	RouteFieldCantEmpty = Error("Route field cannot be empty")
	RouteInvalid        = Error("Invalid route")
)

route

View Source
var (
	PacketWrongType              = Error("Wrong packet type")
	PacketSizeExceed             = Error("Codec: packet size exceeded")
	PacketConnectClosed          = Error("Client connection closed")
	PacketInvalidHeader          = Error("Invalid header")
	PacketMsgSmallerThanExpected = Error("Received less data than expected, EOF?")
)

packet

View Source
var (
	MessageWrongType     = Error("Wrong message type")
	MessageInvalid       = Error("Invalid message")
	MessageRouteNotFound = Error("Route info not found in dictionary")
)

message

View Source
var (
	ClusterClientIsStop           = Error("Cluster client is stopped")
	ClusterRequestTimeout         = Error("Cluster request timeout")
	ClusterPacketMarshalFail      = Error("Cluster packet marshal failed")
	ClusterPacketUnmarshalFail    = Error("Cluster packet unmarshal failed")
	ClusterPublishFail            = Error("Cluster publish failed")
	ClusterRequestFail            = Error("Cluster request failed")
	ClusterNodeTypeIsNil          = Error("Cluster node type is nil")
	ClusterNodeTypeMemberNotFound = Error("Cluster node type member not found")
)

cluster

View Source
var (
	FuncIsNil     = Error("Func is nil")
	FuncTypeError = Error("Func type error")
)

func

View Source
var (
	ActorPathError = Error("Actor path is invalid")
)

actor

View Source
var (
	DiscoveryNotFoundNode = Error("Discovery node not found")
)

discovery

View Source
var (
	ProtobufWrongValueType = Error("Conversion on wrong value type")
)

protobuf

Functions

func Error

func Error(text string) error

Error creates a new error from a static string.

func Errorf

func Errorf(format string, a ...interface{}) error

Errorf creates a new error from a format string and args.

func Wrap added in v1.1.31

func Wrap(err error, text string) error

Wrap wraps an existing error with additional context text.

func Wrapf added in v1.1.31

func Wrapf(err error, format string, a ...interface{}) error

Wrapf wraps an existing error with formatted context text.

Types

This section is empty.

Jump to

Keyboard shortcuts

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