From a38ce127cae77c949a60606fc02c7da10b9be59c Mon Sep 17 00:00:00 2001 From: wentokay <101902546+wentokay@users.noreply.github.com> Date: Wed, 11 May 2022 23:32:02 -0400 Subject: [PATCH] fix: include exception identifier in `catch` blocks (#25147) --- web3.js/src/connection.ts | 4 ++-- web3.js/test/connection.test.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web3.js/src/connection.ts b/web3.js/src/connection.ts index 3e4d4d1d38..2a71a2c8ee 100644 --- a/web3.js/src/connection.ts +++ b/web3.js/src/connection.ts @@ -4847,7 +4847,7 @@ export class Connection { try { this.removeSignatureListener(clientSubscriptionId); // eslint-disable-next-line no-empty - } catch { + } catch (_err) { // Already removed. } } @@ -4895,7 +4895,7 @@ export class Connection { try { this.removeSignatureListener(clientSubscriptionId); // eslint-disable-next-line no-empty - } catch { + } catch (_err) { // Already removed. } }, diff --git a/web3.js/test/connection.test.ts b/web3.js/test/connection.test.ts index 87ddfcfced..7cec3824f4 100644 --- a/web3.js/test/connection.test.ts +++ b/web3.js/test/connection.test.ts @@ -3614,7 +3614,7 @@ describe('Connection', function () { await connection._rpcWebSocket.notify('ping'); break; // eslint-disable-next-line no-empty - } catch {} + } catch (_err) {} await sleep(100); } });