fixed ipcProvider connection error

This commit is contained in:
Fabian Vogelsteller 2015-10-14 23:07:59 +02:00
parent b86d1376ff
commit 8d3d59df26
2 changed files with 2 additions and 13 deletions

View File

@ -25,7 +25,7 @@ module.exports = {
return new Error('Invalid number of input parameters');
},
InvalidConnection: function (host){
return new Error('CONNECTION ERROR: Couldn\'t connect to node '+ host +', is it running?');
return new Error('CONNECTION ERROR: Couldn\'t connect to node '+ host +'.');
},
InvalidProvider: function () {
return new Error('Provider not set or invalid');

View File

@ -25,17 +25,6 @@
var utils = require('../utils/utils');
var errors = require('./errors');
var errorTimeout = function (method, id) {
var err = {
"jsonrpc": "2.0",
"error": {
"code": -32603,
"message": "IPC Request timed out for method \'" + method + "\'"
},
"id": id
};
return JSON.stringify(err);
};
var IpcProvider = function (path, net) {
var _this = this;
@ -158,7 +147,7 @@ Timeout all requests when the end/error event is fired
IpcProvider.prototype._timeout = function() {
for(var key in this.responseCallbacks) {
if(this.responseCallbacks.hasOwnProperty(key)){
this.responseCallbacks[key](errorTimeout(this.responseCallbacks[key].method, key));
this.responseCallbacks[key](errors.InvalidConnection('on IPC'));
delete this.responseCallbacks[key];
}
}