From 7b1130b5bf13d85100eb2d3c8d27ff221cc95029 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Thu, 1 Nov 2018 20:34:48 -0700 Subject: [PATCH] fix: import last id failure error message --- web3.js/src/connection.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web3.js/src/connection.js b/web3.js/src/connection.js index fe13eef1c5..90d8edd4bf 100644 --- a/web3.js/src/connection.js +++ b/web3.js/src/connection.js @@ -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;