server: return result with error
This commit is contained in:
parent
a8ac819139
commit
39ee59c26e
|
@ -132,7 +132,7 @@ func makeJSONRPCHandler(funcMap map[string]*RPCFunc) http.HandlerFunc {
|
||||||
log.Info("HTTPJSONRPC", "method", request.Method, "args", args, "returns", returns)
|
log.Info("HTTPJSONRPC", "method", request.Method, "args", args, "returns", returns)
|
||||||
result, err := unreflectResult(returns)
|
result, err := unreflectResult(returns)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
WriteRPCResponseHTTP(w, NewRPCResponse(request.ID, nil, err.Error()))
|
WriteRPCResponseHTTP(w, NewRPCResponse(request.ID, result, err.Error()))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
WriteRPCResponseHTTP(w, NewRPCResponse(request.ID, result, ""))
|
WriteRPCResponseHTTP(w, NewRPCResponse(request.ID, result, ""))
|
||||||
|
|
Loading…
Reference in New Issue