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

Commit 6ac4719

Browse files
committed
[GB] on global error log the action that received it
1 parent 997c3a0 commit 6ac4719

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

exchange/orders/sticky.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ class StickyOrder extends BaseOrder {
200200
}
201201

202202
if(this.handleError(err)) {
203+
console.log(new Date, 'handleCreate error');
203204
return;
204205
}
205206

@@ -263,6 +264,7 @@ class StickyOrder extends BaseOrder {
263264

264265
this.api.checkOrder(this.id, (err, result) => {
265266
if(this.handleError(err)) {
267+
console.log(new Date, 'checkOrder error');
266268
return;
267269
}
268270

@@ -299,9 +301,12 @@ class StickyOrder extends BaseOrder {
299301
return;
300302
}
301303

304+
// it's not open right now
305+
// meaning we are done
306+
this.sticking = false;
307+
302308
if(!result.executed) {
303309
// not open and not executed means it never hit the book
304-
this.sticking = false;
305310
this.status = states.REJECTED;
306311
this.emitStatus();
307312
this.finish();
@@ -310,10 +315,8 @@ class StickyOrder extends BaseOrder {
310315

311316
// order got filled!
312317
this.orders[this.id].filled = this.amount;
313-
this.sticking = false;
314318
this.emit('fill', this.amount);
315319
this.filled(this.price);
316-
317320
});
318321
}
319322

@@ -375,6 +378,7 @@ class StickyOrder extends BaseOrder {
375378

376379
this.api.cancelOrder(this.id, (err, filled, data) => {
377380
if(this.handleError(err)) {
381+
console.log(new Date, 'error move');
378382
return;
379383
}
380384

@@ -425,7 +429,7 @@ class StickyOrder extends BaseOrder {
425429
) {
426430
this.moveLimitTo = limit;
427431
this.movingLimit = true;
428-
return;
432+
return true;
429433
}
430434

431435
this.limit = this.roundPrice(limit);
@@ -527,6 +531,7 @@ class StickyOrder extends BaseOrder {
527531

528532
this.api.cancelOrder(this.id, (err, filled, data) => {
529533
if(this.handleError(err)) {
534+
console.log(new Date, 'error cancel');
530535
return;
531536
}
532537

@@ -565,6 +570,7 @@ class StickyOrder extends BaseOrder {
565570
// note this is a standalone function after the order is
566571
// completed, as such we do not use the handleError flow.
567572
if(err) {
573+
console.log(new Date, 'error createSummary (checkOrder)')
568574
return next(err);
569575
}
570576

0 commit comments

Comments
 (0)