Closed kettanaito closed 2 months ago
This has been released in v0.29.0!
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.
This is really nice! thanks!
Changes
Adds a new event to the HTTP events map called
unhandledException
. If the listener for that event is provided, whenever an unhandled exception occurs in therequest
listener, theunhandledException
listener will be called (if present).This allows the client to opt-out from the default handling of exceptions (producing 500 error responses), as well as do so conditionally. If the
unhandledException
listener does nothing, the default handling kicks in.Note: The
unhandledException
listener receives a readonlyrequest
instance (non-interactive request). To affect the request, it receives an additionalcontroller
object with methods.respondWith()
and.errorWith()
.