CreateErrorResponse will create a JSON-RPC error response with the given id and error.
(id interface{}, err Error)
| 325 | |
| 326 | // CreateErrorResponse will create a JSON-RPC error response with the given id and error. |
| 327 | func (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. |