Skip to content

Commit b5b52b9

Browse files
authored
fix: avoid instanceof MockNotMatchedError (#4474)
1 parent d0b2899 commit b5b52b9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/mock/mock-utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ function buildMockDispatch () {
367367
try {
368368
mockDispatch.call(this, opts, handler)
369369
} catch (error) {
370-
if (error instanceof MockNotMatchedError) {
370+
if (error.code === 'UND_MOCK_ERR_MOCK_NOT_MATCHED') {
371371
const netConnect = agent[kGetNetConnect]()
372372
if (netConnect === false) {
373373
throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)

0 commit comments

Comments
 (0)