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