Skip to content

Commit

Permalink
remove hardcoded errorcode
Browse files Browse the repository at this point in the history
Signed-off-by: Yilun <zyl.skysniper@gmail.com>
  • Loading branch information
yilunzhang committed Sep 26, 2018
1 parent 65c85a2 commit 52c8354
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/httpjson/RPCserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ func (s *RPCServer) Handle(w http.ResponseWriter, r *http.Request) {
} else {
//if the function does not exist
log.Warn("HTTP JSON RPC Handle - No function to call for ", request["method"])
errcode := common.INVALID_METHOD
data, err := json.Marshal(map[string]interface{}{
"jsonrpc": "2.0",
"error": map[string]interface{}{
"code": -32601,
"message": "Method not found",
"data": "The called method was not found on the server",
"code": -errcode,
"message": common.ErrMessage[errcode],
},
"id": request["id"],
})
Expand Down

0 comments on commit 52c8354

Please sign in to comment.