Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

Commit

Permalink
increased error logging for crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
askmike committed Jan 3, 2014
1 parent 0fe4153 commit 4594349
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions core/databaseManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ Manager.prototype.processTrades = function(data) {

var startFrom = this.mostRecentCandle;
if(startFrom.s > _.first(candles).s) {
console.log(startFrom.s, _.first(candles).s);
console.log(startFrom.s, _.pluck(candles, 's'));
throw 'Weird error 1';
}

Expand Down Expand Up @@ -470,7 +470,7 @@ Manager.prototype.storeCandles = function(candles, cb) {
// throws after passing this check
//
// @link https://gist.github.com/kuzetsa/8230035
if(this.required.to.m < last)
if(this.required.to.m < last) {
log.info([
'\n\n\n',
'If you see this please let me know the following:\n\n',
Expand All @@ -480,7 +480,8 @@ Manager.prototype.storeCandles = function(candles, cb) {
'\n~',
last,
].join(''))
// this.recheckHistory();
this.recheckHistory();
}
}
}

Expand Down Expand Up @@ -526,8 +527,10 @@ Manager.prototype.recheckHistory = function() {
}

var done = function(err) {
if(err)
throw 'Gekko expected the history to be complete, however it was not :(';
if(err) {
console.log('Gekko expected the history to be complete, however it was not :(')
throw err;
}

this.broadcastHistory(err);
}
Expand Down

0 comments on commit 4594349

Please sign in to comment.