ethereum / node-ethereum

[DEPRECATED] a simple standalone or embeddable Ethereum client written for Node.js
GNU General Public License v2.0
46 stars 38 forks source link

xhrrpc does not return error #49

Closed kumavis closed 9 years ago

kumavis commented 9 years ago

it should, but we get back {} somehow....

rpc.processRpc(message, function(err, data){
        if (err) {
          res.status(500).send({ error: err.message });
        } else {
          res.send(data);
        }
      });
kumavis commented 9 years ago

maybe setting the status returns before we send the {errror: err.message}?

kumavis commented 9 years ago

ah, you're returning a string for the error instead of an error object

jorisbontje commented 9 years ago

JSONRPC error handling is defined in http://www.jsonrpc.org/specification#error_object

kumavis commented 9 years ago

I patched this, so im closing