Throwing an error in case of a synchronous call of get() and filterId is not set.

This commit is contained in:
beth.null 2015-09-05 15:24:22 +02:00
parent 383efa7c0d
commit a2ae2d7d95
1 changed files with 3 additions and 0 deletions

View File

@ -211,6 +211,9 @@ Filter.prototype.get = function (callback) {
});
}
} else {
if (this.filterId === null) {
throw new Error('Filter ID Error: filter().get() can\'t be chained synchronous, please provide a callback for the get() method.');
}
var logs = this.implementation.getLogs(this.filterId);
return logs.map(function (log) {
return self.formatter ? self.formatter(log) : log;