Skip to content

Commit

Permalink
mock: remove Error.captureStackTrace in MockNotMatchedError (#3587)
Browse files Browse the repository at this point in the history
* mock: remove Error.captureStackTrace in MockNotMatchedError

* add jsdoc comment
  • Loading branch information
Uzlopak authored Sep 12, 2024
1 parent b54d24b commit cd28ddc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/mock/mock-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit cd28ddc

Please # to comment.