errors

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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