fix error message that print undefined
This commit is contained in:
parent
b85f8aff8c
commit
ef2b4ea570
|
@ -1,7 +1,6 @@
|
|||
require('colors');
|
||||
let fs = require('./fs.js');
|
||||
const date = require('date-and-time');
|
||||
const constants = require('../constants');
|
||||
|
||||
const DATE_FORMAT = 'YYYY-MM-DD HH:mm:ss:SSS';
|
||||
const LOG_REGEX = new RegExp(/\[(\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d:\d\d\d)\] (?:\[(\w*)\]:?)?\s?\s?(.*)/gmi);
|
||||
|
@ -91,7 +90,7 @@ Logger.prototype.error = function () {
|
|||
return;
|
||||
}
|
||||
this.events.emit("log", "error", ...arguments);
|
||||
this.logFunction(...Array.from(arguments).map(t => {return t ? t.red : t;}));
|
||||
this.logFunction(...Array.from(arguments).map(t => { return t ? t.red : t; }));
|
||||
this.writeToFile("[error]: ", ...arguments);
|
||||
};
|
||||
|
||||
|
@ -100,7 +99,7 @@ Logger.prototype.warn = function () {
|
|||
return;
|
||||
}
|
||||
this.events.emit("log", "warn", ...arguments);
|
||||
this.logFunction(...Array.from(arguments).map(t => {return t ? t.yellow : t;}));
|
||||
this.logFunction(...Array.from(arguments).map(t => { return t ? t.yellow : t; }));
|
||||
this.writeToFile("[warning]: ", ...arguments);
|
||||
};
|
||||
|
||||
|
@ -109,7 +108,7 @@ Logger.prototype.info = function () {
|
|||
return;
|
||||
}
|
||||
this.events.emit("log", "info", ...arguments);
|
||||
this.logFunction(...Array.from(arguments).map(t => {return t ? t.green : t;}));
|
||||
this.logFunction(...Array.from(arguments).map(t => { return t ? t.green : t; }));
|
||||
this.writeToFile("[info]: ", ...arguments);
|
||||
};
|
||||
|
||||
|
|
|
@ -538,8 +538,8 @@ class BlockchainConnector {
|
|||
function(next) {
|
||||
async.times(limit, function(n, eachCb) {
|
||||
self.web3.eth.getBlock(from - n, returnTransactionObjects, function(err, block) {
|
||||
if (err) {
|
||||
self.logger.error(err);
|
||||
if (err && err.message) {
|
||||
// FIXME Returns an error because we are too low
|
||||
return eachCb();
|
||||
}
|
||||
blocks.push(block);
|
||||
|
|
Loading…
Reference in New Issue