log error on console, if api returns an error

This commit is contained in:
Marek Kotewicz 2015-01-28 00:07:03 +01:00
parent 83fad0fb59
commit 1345a8c67c
4 changed files with 15 additions and 3 deletions

6
dist/ethereum.js vendored
View File

@ -783,6 +783,12 @@ ProviderManager.prototype.send = function(data) {
//TODO: handle error here? //TODO: handle error here?
var result = this.provider.send(data); var result = this.provider.send(data);
result = JSON.parse(result); result = JSON.parse(result);
if (result.error) {
console.log(result.error);
return null;
}
return result.result; return result.result;
}; };

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -76,6 +76,12 @@ ProviderManager.prototype.send = function(data) {
//TODO: handle error here? //TODO: handle error here?
var result = this.provider.send(data); var result = this.provider.send(data);
result = JSON.parse(result); result = JSON.parse(result);
if (result.error) {
console.log(result.error);
return null;
}
return result.result; return result.result;
}; };