From 6a0b1185d63928a31f48e3af5e7e43cdddf99d02 Mon Sep 17 00:00:00 2001 From: Aras Abbasi Date: Thu, 21 Aug 2025 16:17:28 +0200 Subject: [PATCH] chore: remove unused exceptions in try catch blocks --- build/wasm.js | 4 ++-- docs/examples/snapshot-testing.js | 2 +- lib/dispatcher/client-h1.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/wasm.js b/build/wasm.js index 46cd273a3a2..179a9011475 100644 --- a/build/wasm.js +++ b/build/wasm.js @@ -69,10 +69,10 @@ if (process.argv[2] === '--docker') { } const hasApk = (function () { - try { execSync('command -v apk'); return true } catch (error) { return false } + try { execSync('command -v apk'); return true } catch { return false } })() const hasOptimizer = (function () { - try { execSync(`${WASM_OPT} --version`); return true } catch (error) { return false } + try { execSync(`${WASM_OPT} --version`); return true } catch { return false } })() if (hasApk) { // Gather information about the tools used for the build diff --git a/docs/examples/snapshot-testing.js b/docs/examples/snapshot-testing.js index 5d506a3ace0..681ddda7dd1 100644 --- a/docs/examples/snapshot-testing.js +++ b/docs/examples/snapshot-testing.js @@ -92,7 +92,7 @@ async function basicSnapshotExample () { const { unlink } = require('node:fs/promises') await unlink(snapshotPath) console.log('\n🗑️ Cleaned up temporary snapshot file') - } catch (error) { + } catch { // File might not exist or already be deleted } } diff --git a/lib/dispatcher/client-h1.js b/lib/dispatcher/client-h1.js index 92fe69ac540..5e5d89a7b9e 100644 --- a/lib/dispatcher/client-h1.js +++ b/lib/dispatcher/client-h1.js @@ -66,7 +66,7 @@ function lazyllhttp () { let mod try { mod = new WebAssembly.Module(require('../llhttp/llhttp_simd-wasm.js')) - } catch (e) { + } catch { /* istanbul ignore next */ // We could check if the error was caused by the simd option not