fix: import last id failure error message

This commit is contained in:
Michael Vines
2018-11-01 20:34:48 -07:00
parent f2f856356b
commit 7b1130b5bf

View File

@ -391,6 +391,7 @@ export class Connection {
// Fetch a new last id // Fetch a new last id
let attempts = 0; let attempts = 0;
const startTime = Date.now();
for (;;) { for (;;) {
const lastId = await this.getLastId(); const lastId = await this.getLastId();
@ -403,7 +404,7 @@ export class Connection {
break; break;
} }
if (attempts === 8) { if (attempts === 8) {
throw new Error('Unable to obtain new last id'); throw new Error(`Unable to obtain a new last id after ${Date.now() - startTime}ms`);
} }
await sleep(250); await sleep(250);
++attempts; ++attempts;