fix(network): improve error message when response.body() is called after navigation#41527
Conversation
…ter navigation
When response.body() / response.text() / response.json() are called
after the page has navigated, Chrome and WebKit throw a cryptic
ProtocolError ("No resource with given identifier found" or "Missing
content of resource for given requestId"). Wrap the protocol call in a
try/catch and append a human-readable explanation when a ProtocolError
is detected.
Fixes: microsoft#41512
Test results for "MCP"2 failed 7459 passed, 1132 skipped Merge workflow run. |
Test results for "tests 1"3 failed 4 flaky49173 passed, 1164 skipped Merge workflow run. |
Summary
ProtocolErrors whenresponse.body()is called after navigation:No resource with given identifier found/Missing content of resource for given requestIdinternalBody()and appends a navigation-race explanation so users know what happenedFixes #41512