mirror of
https://github.com/status-im/web3.js.git
synced 2025-02-22 02:58:30 +00:00
fixed ipcProvider connection error
This commit is contained in:
parent
b86d1376ff
commit
8d3d59df26
@ -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');
|
||||
|
@ -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];
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user