From cd28ddcfbb1a62c627d21369691dba43ffc29998 Mon Sep 17 00:00:00 2001 From: Aras Abbasi Date: Thu, 12 Sep 2024 09:08:51 +0200 Subject: [PATCH] mock: remove Error.captureStackTrace in MockNotMatchedError (#3587) * mock: remove Error.captureStackTrace in MockNotMatchedError * add jsdoc comment --- lib/mock/mock-errors.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/mock/mock-errors.js b/lib/mock/mock-errors.js index 5442c0e8d2c..ebdc786c56e 100644 --- a/lib/mock/mock-errors.js +++ b/lib/mock/mock-errors.js @@ -2,10 +2,12 @@ const { UndiciError } = require('../core/errors') +/** + * The request does not match any registered mock dispatches. + */ 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'