sdkerrs

package
v3.8.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

View Source
const (
	NetworkError             = 10000
	NetworkTimeoutError      = 10001
	ArgsError                = 10002 // Invalid input parameters
	CtxDeadlineExceededError = 10003 // Context deadline exceeded

	ResourceLoadNotCompleteError = 10004 // Resource initialization incomplete
	UnknownCode                  = 10005 // Unrecognized code
	SdkInternalError             = 10006 // SDK internal error

	NoUpdateError = 10007 // No updates available

	UserIDNotFoundError = 10100 // UserID not found or not registered
	LoginOutError       = 10101 // User has logged out
	LoginRepeatError    = 10102 // User logged in repeatedly

	// Message-related errors
	FileNotFoundError             = 10200 // Record not found
	MsgDeCompressionError         = 10201 // Message decompression failed
	MsgDecodeBinaryWsError        = 10202 // Message decoding failed
	MsgBinaryTypeNotSupportError  = 10203 // Message type not supported
	MsgRepeatError                = 10204 // Message repeated
	MsgContentTypeNotSupportError = 10205 // Message content type not supported
	MsgHasNoSeqError              = 10206 // Message does not have a sequence number

	// Conversation-related errors
	NotSupportOptError  = 10301 // Operation not supported
	NotSupportTypeError = 10302 // Type not supported
	UnreadCountError    = 10303 // Unread count is zero

	// Group-related errors
	GroupIDNotFoundError = 10400 // GroupID not found
	GroupTypeErr         = 10401 // Invalid group type
)

Common error codes

Variables

View Source
var (
	Wrap    = errs.Wrap
	WrapMsg = errs.WrapMsg
)
View Source
var (
	// Common errors
	ErrArgs           = errs.NewCodeError(ArgsError, "Invalid input arguments")
	ErrCtxDeadline    = errs.NewCodeError(CtxDeadlineExceededError, "Context deadline exceeded")
	ErrSdkInternal    = errs.NewCodeError(SdkInternalError, "Internal SDK error")
	ErrNetwork        = errs.NewCodeError(NetworkError, "Network error")
	ErrNetworkTimeOut = errs.NewCodeError(NetworkTimeoutError, "Network timeout error")

	ErrGroupIDNotFound = errs.NewCodeError(GroupIDNotFoundError, "Group ID not found")
	ErrUserIDNotFound  = errs.NewCodeError(UserIDNotFoundError, "User ID not found")

	ErrResourceLoad = errs.NewCodeError(ResourceLoadNotCompleteError, "Resource initialization incomplete")

	// Message-related errors
	ErrFileNotFound             = errs.NewCodeError(FileNotFoundError, "File not found")
	ErrMsgDecodeBinaryWs        = errs.NewCodeError(MsgDecodeBinaryWsError, "Message binary WebSocket decoding failed")
	ErrMsgDeCompression         = errs.NewCodeError(MsgDeCompressionError, "Message decompression failed")
	ErrMsgBinaryTypeNotSupport  = errs.NewCodeError(MsgBinaryTypeNotSupportError, "Message type not supported")
	ErrMsgRepeated              = errs.NewCodeError(MsgRepeatError, "Only failed messages can be resent")
	ErrMsgContentTypeNotSupport = errs.NewCodeError(MsgContentTypeNotSupportError, "Message content type not supported")
	ErrMsgHasNoSeq              = errs.NewCodeError(MsgHasNoSeqError, "Message has no sequence number")

	// Conversation-related errors
	ErrNotSupportOpt  = errs.NewCodeError(NotSupportOptError, "Operation not supported for supergroup")
	ErrNotSupportType = errs.NewCodeError(NotSupportTypeError, "Only supergroup type supported")
	ErrUnreadCount    = errs.NewCodeError(UnreadCountError, "Unread count is zero")

	// Group-related errors
	ErrGroupType = errs.NewCodeError(GroupTypeErr, "Invalid group type")

	ErrLoginOut    = errs.NewCodeError(LoginOutError, "User has logged out")
	ErrLoginRepeat = errs.NewCodeError(LoginRepeatError, "User has logged in repeatedly")
)

Functions

func New

func New(code int, msg string, dtl string) errs.CodeError

Types

This section is empty.

Jump to

Keyboard shortcuts

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