picked watch change2

This commit is contained in:
Fabian Vogelsteller 2015-04-01 15:38:15 +02:00
parent 2215e7c3af
commit 56d13f72fb
8 changed files with 62 additions and 17 deletions

21
dist/web3-light.js vendored
View File

@ -1625,6 +1625,9 @@ var utils = require('../utils/utils');
module.exports = {
InvalidNumberOfParams: new Error('Invalid number of input parameters'),
NoConnection: function(host){
return new Error('CONNECTION ERROR: Couldn\'t connect to node '+ host +', is it running?');
},
InvalidProvider: new Error('Providor not set or invalid'),
InvalidResponse: function(result){
var message = 'Invalid JSON RPC response';
@ -2404,6 +2407,7 @@ module.exports = {
"use strict";
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest; // jshint ignore:line
var errors = require('./errors');
var HttpProvider = function (host) {
this.host = host || 'http://localhost:8080';
@ -2413,7 +2417,13 @@ HttpProvider.prototype.send = function (payload) {
var request = new XMLHttpRequest();
request.open('POST', this.host, false);
request.send(JSON.stringify(payload));
try {
request.send(JSON.stringify(payload));
} catch(error) {
throw errors.NoConnection(this.host);
}
// check request.status
// TODO: throw an error here! it cannot silently fail!!!
@ -2433,13 +2443,18 @@ HttpProvider.prototype.sendAsync = function (payload, callback) {
};
request.open('POST', this.host, true);
request.send(JSON.stringify(payload));
try {
request.send(JSON.stringify(payload));
} catch(error) {
throw errors.NoConnection(this.host);
}
};
module.exports = HttpProvider;
},{"xmlhttprequest":5}],18:[function(require,module,exports){
},{"./errors":12,"xmlhttprequest":5}],18:[function(require,module,exports){
/*
This file is part of ethereum.js.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

21
dist/web3.js vendored
View File

@ -1625,6 +1625,9 @@ var utils = require('../utils/utils');
module.exports = {
InvalidNumberOfParams: new Error('Invalid number of input parameters'),
NoConnection: function(host){
return new Error('CONNECTION ERROR: Couldn\'t connect to node '+ host +', is it running?');
},
InvalidProvider: new Error('Providor not set or invalid'),
InvalidResponse: function(result){
var message = 'Invalid JSON RPC response';
@ -2404,6 +2407,7 @@ module.exports = {
"use strict";
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest; // jshint ignore:line
var errors = require('./errors');
var HttpProvider = function (host) {
this.host = host || 'http://localhost:8080';
@ -2413,7 +2417,13 @@ HttpProvider.prototype.send = function (payload) {
var request = new XMLHttpRequest();
request.open('POST', this.host, false);
request.send(JSON.stringify(payload));
try {
request.send(JSON.stringify(payload));
} catch(error) {
throw errors.NoConnection(this.host);
}
// check request.status
// TODO: throw an error here! it cannot silently fail!!!
@ -2433,13 +2443,18 @@ HttpProvider.prototype.sendAsync = function (payload, callback) {
};
request.open('POST', this.host, true);
request.send(JSON.stringify(payload));
try {
request.send(JSON.stringify(payload));
} catch(error) {
throw errors.NoConnection(this.host);
}
};
module.exports = HttpProvider;
},{"xmlhttprequest":5}],18:[function(require,module,exports){
},{"./errors":12,"xmlhttprequest":5}],18:[function(require,module,exports){
/*
This file is part of ethereum.js.

6
dist/web3.js.map vendored

File diff suppressed because one or more lines are too long

4
dist/web3.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -24,6 +24,9 @@ var utils = require('../utils/utils');
module.exports = {
InvalidNumberOfParams: new Error('Invalid number of input parameters'),
NoConnection: function(host){
return new Error('CONNECTION ERROR: Couldn\'t connect to node '+ host +', is it running?');
},
InvalidProvider: new Error('Providor not set or invalid'),
InvalidResponse: function(result){
var message = 'Invalid JSON RPC response';

View File

@ -25,6 +25,7 @@
"use strict";
var XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest; // jshint ignore:line
var errors = require('./errors');
var HttpProvider = function (host) {
this.host = host || 'http://localhost:8080';
@ -34,7 +35,13 @@ HttpProvider.prototype.send = function (payload) {
var request = new XMLHttpRequest();
request.open('POST', this.host, false);
request.send(JSON.stringify(payload));
try {
request.send(JSON.stringify(payload));
} catch(error) {
throw errors.NoConnection(this.host);
}
// check request.status
// TODO: throw an error here! it cannot silently fail!!!
@ -54,7 +61,12 @@ HttpProvider.prototype.sendAsync = function (payload, callback) {
};
request.open('POST', this.host, true);
request.send(JSON.stringify(payload));
try {
request.send(JSON.stringify(payload));
} catch(error) {
throw errors.NoConnection(this.host);
}
};
module.exports = HttpProvider;