errors

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrCodeParseError     = -32700
	ErrCodeInvalidRequest = -32600
	ErrCodeMethodNotFound = -32601
	ErrCodeInvalidParams  = -32602
	ErrCodeInternalError  = -32603
	ErrCodeServerError    = -32000
	ErrCodeTimeout        = -32001
	ErrCodeUnauthorized   = -32604
)

Variables

View Source
var (
	ErrCodeContextNil     = -32010
	ErrCodeContextTimeout = -32011
	ErrCodeContextCancel  = -32012

	DefaultMinTimeout = 100 * time.Millisecond
	DefaultMaxTimeout = 5 * time.Minute
)

Functions

func ValidateContext

func ValidateContext(ctx context.Context) error

Types

type ContextError

type ContextError struct {
	Code    int
	Message string
	Cause   error
}

func NewContextError

func NewContextError(code int, message string) *ContextError

func (*ContextError) Error

func (e *ContextError) Error() string

func (*ContextError) Unwrap

func (e *ContextError) Unwrap() error

func (*ContextError) WithCause

func (e *ContextError) WithCause(cause error) *ContextError

type JSONRPCError

type JSONRPCError struct {
	Code    int             `json:"code"`
	Message string          `json:"message"`
	Data    json.RawMessage `json:"data,omitempty"`
}

func NewJSONRPCError

func NewJSONRPCError(code int, message string) *JSONRPCError

func (*JSONRPCError) Error

func (e *JSONRPCError) Error() string

Jump to

Keyboard shortcuts

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