Closed mikicho closed 1 year ago
Oh, I see. Since the thrown errors result in error
being emitted, and we have the suppressing logic in there, those user-defined errors never get emitted.
I think this should be fairly easy to fix by introducing a state that tells the interceptor that we are past socket connection phase, and it should no longer suppress the errors. This is a bit naive and relies on the suppressed errors originating from the connection alone but that's also the only use case we have for those suppressed errors as of now.
Great. I can open a PR if needed.
That would be much appreciated! Let's iterate on it together.
This has been released in v0.25.7!
Make sure to always update to the latest version (npm i @mswjs/interceptors@latest
) to get the newest features and bug fixes.
Predictable release automation by @ossjs/release.
Currently, we suppress all errors for specific types, which prevent the user to throw these error within the interceptors handler:
As I see it, we can do one of two things:
resourceSource
topass
or toundefined