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
1 changed files with 2 additions and 1 deletions

View File

@ -391,6 +391,7 @@ export class Connection {
// Fetch a new last id
let attempts = 0;
const startTime = Date.now();
for (;;) {
const lastId = await this.getLastId();
@ -403,7 +404,7 @@ export class Connection {
break;
}
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);
++attempts;