diff options
author | Bas van Kervel <bas@ethdev.com> | 2015-06-09 15:48:18 +0800 |
---|---|---|
committer | Bas van Kervel <basvankervel@gmail.com> | 2015-06-11 20:01:41 +0800 |
commit | 09d0d55fc579701191ff34f38cc20b437ee23577 (patch) | |
tree | 16f77a960c7428145961891b7f116e25dc6daf1b /rpc/shared | |
parent | faab931ce1282dea50c8fdf0577c42ee67f69828 (diff) | |
download | go-tangerine-09d0d55fc579701191ff34f38cc20b437ee23577.tar go-tangerine-09d0d55fc579701191ff34f38cc20b437ee23577.tar.gz go-tangerine-09d0d55fc579701191ff34f38cc20b437ee23577.tar.bz2 go-tangerine-09d0d55fc579701191ff34f38cc20b437ee23577.tar.lz go-tangerine-09d0d55fc579701191ff34f38cc20b437ee23577.tar.xz go-tangerine-09d0d55fc579701191ff34f38cc20b437ee23577.tar.zst go-tangerine-09d0d55fc579701191ff34f38cc20b437ee23577.zip |
added debug API
Diffstat (limited to 'rpc/shared')
-rw-r--r-- | rpc/shared/types.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/rpc/shared/types.go b/rpc/shared/types.go index 600d39541..6a29fa88e 100644 --- a/rpc/shared/types.go +++ b/rpc/shared/types.go @@ -2,6 +2,7 @@ package shared import ( "encoding/json" + "github.com/ethereum/go-ethereum/logger" "github.com/ethereum/go-ethereum/logger/glog" ) @@ -45,15 +46,15 @@ func NewRpcResponse(id interface{}, jsonrpcver string, reply interface{}, err er var response interface{} switch err.(type) { - case nil: + case nil: response = &SuccessResponse{Jsonrpc: jsonrpcver, Id: id, Result: reply} - case *NotImplementedError: + case *NotImplementedError: jsonerr := &ErrorObject{-32601, err.Error()} response = &ErrorResponse{Jsonrpc: jsonrpcver, Id: id, Error: jsonerr} - case *DecodeParamError, *InsufficientParamsError, *ValidationError, *InvalidTypeError: + case *DecodeParamError, *InsufficientParamsError, *ValidationError, *InvalidTypeError: jsonerr := &ErrorObject{-32602, err.Error()} response = &ErrorResponse{Jsonrpc: jsonrpcver, Id: id, Error: jsonerr} - default: + default: jsonerr := &ErrorObject{-32603, err.Error()} response = &ErrorResponse{Jsonrpc: jsonrpcver, Id: id, Error: jsonerr} } |