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;