From 04158ee455c7abd761916dc4b70040d7a7ee658c Mon Sep 17 00:00:00 2001 From: Bryon M <96934965+bryon-cryptoconsults@users.noreply.github.com> Date: Mon, 4 Apr 2022 07:11:20 -0400 Subject: [PATCH] fix: stop logging to console when send tx fails (#23511) There is no need to log the error to the console. Developers can simply catch the error and handle it themselves without it cluttering production logs. --- web3.js/src/connection.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/web3.js/src/connection.ts b/web3.js/src/connection.ts index f572c9d58..489752108 100644 --- a/web3.js/src/connection.ts +++ b/web3.js/src/connection.ts @@ -4048,11 +4048,6 @@ export class Connection { let logs; if ('data' in res.error) { logs = res.error.data.logs; - if (logs && Array.isArray(logs)) { - const traceIndent = '\n '; - const logTrace = traceIndent + logs.join(traceIndent); - console.error(res.error.message, logTrace); - } } throw new SendTransactionError( 'failed to send transaction: ' + res.error.message,