MCPcopy Create free account
hub / github.com/CPChain/chain / CreateErrorResponseWithInfo

Method CreateErrorResponseWithInfo

api/rpc/json.go:333–336  ·  view source on GitHub ↗

CreateErrorResponseWithInfo will create a JSON-RPC error response with the given id and error. info is optional and contains additional information about the error. When an empty string is passed it is ignored.

(id interface{}, err Error, info interface{})

Source from the content-addressed store, hash-verified

331// CreateErrorResponseWithInfo will create a JSON-RPC error response with the given id and error.
332// info is optional and contains additional information about the error. When an empty string is passed it is ignored.
333func (c *jsonCodec) CreateErrorResponseWithInfo(id interface{}, err Error, info interface{}) interface{} {
334 return &jsonErrResponse{Version: jsonrpcVersion, Id: id,
335 Error: jsonError{Code: err.ErrorCode(), Message: err.Error(), Data: info}}
336}
337
338// CreateNotification will create a JSON-RPC notification with the given subscription id and event as params.
339func (c *jsonCodec) CreateNotification(subid, namespace string, event interface{}) interface{} {

Callers

nothing calls this directly

Calls 2

ErrorCodeMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected