From ea7b00701f216659590383602eba4202fd83f751 Mon Sep 17 00:00:00 2001 From: uzlopak Date: Thu, 12 Sep 2024 04:39:09 +0200 Subject: [PATCH 1/2] mock: remove Error.captureStackTrace in MockNotMatchedError --- lib/mock/mock-errors.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/mock/mock-errors.js b/lib/mock/mock-errors.js index 5442c0e8d2c..25d38ed98b4 100644 --- a/lib/mock/mock-errors.js +++ b/lib/mock/mock-errors.js @@ -5,7 +5,6 @@ const { UndiciError } = require('../core/errors') class MockNotMatchedError extends UndiciError { constructor (message) { super(message) - Error.captureStackTrace(this, MockNotMatchedError) this.name = 'MockNotMatchedError' this.message = message || 'The request does not match any registered mock dispatches' this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED' From 150731cc89936a89d4ad3dcc7a10e8ee7eb24b7e Mon Sep 17 00:00:00 2001 From: uzlopak Date: Thu, 12 Sep 2024 04:41:20 +0200 Subject: [PATCH 2/2] add jsdoc comment --- lib/mock/mock-errors.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/mock/mock-errors.js b/lib/mock/mock-errors.js index 25d38ed98b4..ebdc786c56e 100644 --- a/lib/mock/mock-errors.js +++ b/lib/mock/mock-errors.js @@ -2,6 +2,9 @@ const { UndiciError } = require('../core/errors') +/** + * The request does not match any registered mock dispatches. + */ class MockNotMatchedError extends UndiciError { constructor (message) { super(message)