Move request error message from the worker to the main thread #1683
Labels
BREAKING CHANGE
Pull request introducing breaking changes.
DX
feature
scope:browser
Related to MSW running in a browser
Milestone
Scope
Improves an existing behavior
Compatibility
Feature description
Right now, whenever any request errors, MSW will produce the error message saying that something went wrong and it's unlikely an issue with MSW. That error message is really meant only for one purpose: to facilitate exceptions rising from the request handlers. But since it's just a
try/catch
block around the entirefetch
event in the worker, that message also gets printed when extraneous request error, including requests that are meant to error by the developer.Expected behavior
References
msw/src/mockServiceWorker.js
Lines 128 to 136 in e87e00b
The text was updated successfully, but these errors were encountered: