From 487c719dddf0cb37e4054cecdac13d286741be09 Mon Sep 17 00:00:00 2001 From: wnghdcjfe Date: Sun, 17 Nov 2024 15:12:40 +0900 Subject: [PATCH] closed #5258 --- lib/cli/run-helpers.js | 4 ++-- lib/cli/watch-run.js | 4 ++-- lib/mocha.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/cli/run-helpers.js b/lib/cli/run-helpers.js index ec65829f14..f838ba0e86 100644 --- a/lib/cli/run-helpers.js +++ b/lib/cli/run-helpers.js @@ -284,8 +284,8 @@ exports.validateLegacyPlugin = (opts, pluginType, map = {}) => { // Try to load reporters from a cwd-relative path try { map[pluginId] = require(path.resolve(pluginId)); - } catch (e) { - throw createUnknownError(e); + } catch (err) { + throw createUnknownError(err); } } } diff --git a/lib/cli/watch-run.js b/lib/cli/watch-run.js index 6d5c6c26a7..644f79d3be 100644 --- a/lib/cli/watch-run.js +++ b/lib/cli/watch-run.js @@ -270,8 +270,8 @@ const createRerunner = (mocha, watcher, {beforeRun} = {}) => { console.error(`${logSymbols.info} [mocha] waiting for changes...`); } }); - } catch (e) { - console.error(e.stack); + } catch (err) { + console.error(err.stack); } }; diff --git a/lib/mocha.js b/lib/mocha.js index c6ee248561..7e7c7d33f1 100644 --- a/lib/mocha.js +++ b/lib/mocha.js @@ -344,8 +344,8 @@ Mocha.prototype.reporter = function (reporterName, reporterOptions) { // Try to load reporters from a cwd-relative path try { reporter = require(path.resolve(reporterName)); - } catch (e) { - throw createInvalidReporterError(e.message, reporterName); + } catch (err) { + throw createInvalidReporterError(err.message, reporterName); } } }