Remove errParseRequest
This commit is contained in:
parent
43acad81b3
commit
c8e9abff53
@ -92,7 +92,7 @@ func (s *RpcHttpServer) apiHandler(api *rpc.EthereumApi) http.Handler {
|
|||||||
|
|
||||||
reqParsed, reqerr := JSON.ParseRequestBody(req)
|
reqParsed, reqerr := JSON.ParseRequestBody(req)
|
||||||
if reqerr != nil {
|
if reqerr != nil {
|
||||||
jsonerr := &rpc.RpcErrorObject{-32700, rpc.ErrorParseRequest}
|
jsonerr := &rpc.RpcErrorObject{-32700, "Error: Could not parse request"}
|
||||||
JSON.Send(w, &rpc.RpcErrorResponse{JsonRpc: jsonrpcver, ID: nil, Error: jsonerr})
|
JSON.Send(w, &rpc.RpcErrorResponse{JsonRpc: jsonrpcver, ID: nil, Error: jsonerr})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,6 @@ var (
|
|||||||
errArguments = errors.New("Error: Insufficient arguments")
|
errArguments = errors.New("Error: Insufficient arguments")
|
||||||
errNotImplemented = errors.New("Error: Method not implemented")
|
errNotImplemented = errors.New("Error: Method not implemented")
|
||||||
errUnknown = errors.New("Error: Unknown error")
|
errUnknown = errors.New("Error: Unknown error")
|
||||||
errParseRequest = errors.New("Error: Could not parse request")
|
|
||||||
errDecodeArgs = errors.New("Error: Could not decode arguments")
|
errDecodeArgs = errors.New("Error: Could not decode arguments")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ func sockHandler(api *rpc.EthereumApi) websocket.Handler {
|
|||||||
|
|
||||||
// reqParsed, reqerr := JSON.ParseRequestBody(conn.Request())
|
// reqParsed, reqerr := JSON.ParseRequestBody(conn.Request())
|
||||||
if err := websocket.JSON.Receive(conn, &reqParsed); err != nil {
|
if err := websocket.JSON.Receive(conn, &reqParsed); err != nil {
|
||||||
jsonerr := &rpc.RpcErrorObject{-32700, rpc.ErrorParseRequest}
|
jsonerr := &rpc.RpcErrorObject{-32700, "Error: Could not parse request"}
|
||||||
JSON.Send(conn, &rpc.RpcErrorResponse{JsonRpc: jsonrpcver, ID: nil, Error: jsonerr})
|
JSON.Send(conn, &rpc.RpcErrorResponse{JsonRpc: jsonrpcver, ID: nil, Error: jsonerr})
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user