code

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2018 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package code defines error code values used by the jrpc2 package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Code

type Code int32

A Code is an error response code, that satisfies the error interface.

const (
	ParseError     Code = -32700 // Invalid JSON received by the server
	InvalidRequest Code = -32600 // The JSON sent is not a valid request object
	MethodNotFound Code = -32601 // The method does not exist or is unavailable
	InvalidParams  Code = -32602 // Invalid method parameters
	InternalError  Code = -32603 // Internal JSON-RPC error

	NoError          Code = -32099 // Denotes a nil error
	SystemError      Code = -32098 // Errors from the operating environment
	Cancelled        Code = -32097 // Request cancelled
	DeadlineExceeded Code = -32096 // Request deadline exceeded
)

Pre-defined error codes, including the standard ones from the JSON-RPC specification and some specific to this implementation.

func Register

func Register(value int32, message string) Code

Register adds a new Code value with the specified message string. This function will panic if the proposed value is already registered.

func (Code) Error

func (c Code) Error() string

Jump to

Keyboard shortcuts

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