diff options
Diffstat (limited to 'rpc/shared')
-rw-r--r-- | rpc/shared/types.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/rpc/shared/types.go b/rpc/shared/types.go index 659b74bf6..dd9a60aab 100644 --- a/rpc/shared/types.go +++ b/rpc/shared/types.go @@ -74,11 +74,9 @@ type ErrorObject struct { } // Create RPC error response, this allows for custom error codes -func NewRpcErrorResponse(id interface{}, jsonrpcver string, errCode int, err error) *interface{} { - var response interface{} - +func NewRpcErrorResponse(id interface{}, jsonrpcver string, errCode int, err error) *ErrorResponse { jsonerr := &ErrorObject{errCode, err.Error()} - response = ErrorResponse{Jsonrpc: jsonrpcver, Id: id, Error: jsonerr} + response := ErrorResponse{Jsonrpc: jsonrpcver, Id: id, Error: jsonerr} glog.V(logger.Detail).Infof("Generated error response: %s", response) return &response |