From f9b36e4acf59ea33e7ed20944b0412a320879827 Mon Sep 17 00:00:00 2001 From: Bas van Kervel Date: Tue, 2 Jun 2015 15:22:58 +0200 Subject: [PATCH] show RPC error message in console --- rpc/jeth.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpc/jeth.go b/rpc/jeth.go index 5e6dcca3bd..4587c864ba 100644 --- a/rpc/jeth.go +++ b/rpc/jeth.go @@ -34,9 +34,7 @@ func (self *Jeth) err(call otto.FunctionCall, code int, msg string, id interface } func (self *Jeth) Send(call otto.FunctionCall) (response otto.Value) { - reqif, err := call.Argument(0).Export() - if err != nil { return self.err(call, -32700, err.Error(), nil) } @@ -85,6 +83,8 @@ func (self *Jeth) Send(call otto.FunctionCall) (response otto.Value) { ret_response[response_idx] = { jsonrpc: ret_jsonrpc, id: ret_id, result: JSON.parse(ret_result) }; `) } else if res, ok := respif.(shared.ErrorResponse); ok { + fmt.Printf("Error: %s (%d)\n", res.Error.Message, res.Error.Code) + call.Otto.Set("ret_id", res.Id) call.Otto.Set("ret_jsonrpc", res.Jsonrpc) call.Otto.Set("ret_error", res.Error)