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

Method CreateErrorResponse

api/rpc/json.go:327–329  ·  view source on GitHub ↗

CreateErrorResponse will create a JSON-RPC error response with the given id and error.

(id interface{}, err Error)

Source from the content-addressed store, hash-verified

325
326// CreateErrorResponse will create a JSON-RPC error response with the given id and error.
327func (c *jsonCodec) CreateErrorResponse(id interface{}, err Error) interface{} {
328 return &jsonErrResponse{Version: jsonrpcVersion, Id: id, Error: jsonError{Code: err.ErrorCode(), Message: err.Error()}}
329}
330
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.

Callers

nothing calls this directly

Calls 2

ErrorCodeMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected