You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e2af5aa
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: src/browser/sources/service-worker-source.ts
+2-7Lines changed: 2 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -382,15 +382,10 @@ class ServiceWorkerHttpNetworkFrame extends HttpNetworkFrame {
382
382
}
383
383
384
384
if(reasoninstanceofError){
385
-
devUtils.error(
386
-
`Uncaught exception in the request handler for "%s %s":
387
-
388
-
%s
389
-
390
-
This exception has been gracefully handled as a 500 response, however, it's strongly recommended to resolve this error, as it indicates a mistake in your code. If you wish to mock an error response, please see this guide: https://mswjs.io/docs/http/mocking-responses/error-responses`,
385
+
devUtils.warn(
386
+
`Uncaught exception in the request handler for "%s %s". This exception has been gracefully handled as a 500 response, however, it's strongly recommended to resolve this error, as it indicates a mistake in your code. If you wish to mock an error response, please see this guide: https://mswjs.io/docs/http/mocking-responses/error-responses`,
391
387
this.data.request.method,
392
388
this.data.request.url,
393
-
reason.stack??reason,
394
389
)
395
390
396
391
// Treat exceptions during the request handling as 500 responses.
// Expect standard request failure message from the browser.
26
-
awaitwaitFor(()=>{
27
-
expect(consoleSpy.get('error')).toEqual(
25
+
awaitexpect
26
+
.poll(()=>consoleSpy.get('error'))
27
+
.toEqual(
28
28
expect.arrayContaining([
29
29
expect.stringContaining(
30
30
'Failed to load resource: the server responded with a status of 500',
31
31
),
32
32
]),
33
33
)
34
-
})
35
34
36
-
expect(consoleSpy.get('error')).toEqual(
35
+
expect(consoleSpy.get('warning')).toEqual(
37
36
expect.arrayContaining([
38
-
expect.stringContaining(`\
39
-
[MSW] Uncaught exception in the request handler for "GET ${endpointUrl}":
40
-
41
-
Error: Custom error message
42
-
`),
37
+
expect.stringContaining(
38
+
`This exception has been gracefully handled as a 500 response, however, it's strongly recommended to resolve this error, as it indicates a mistake in your code. If you wish to mock an error response, please see this guide: https://mswjs.io/docs/http/mocking-responses/error-responses`,
0 commit comments