fix(fetch): preserve node error fields across serialization - #42562
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| else | ||
| e = Object.assign(new PlaywrightError(error.error.message), { name: error.error.name }); | ||
| e.stack = error.error.stack || ''; | ||
| parseSystemErrorFields(error.error, e); |
There was a problem hiding this comment.
can we just append it to the message, so that it works across langs?
Serialize the structured fields of a Node.js system error (code, errno, syscall, address, port, hostname) alongside the message, so that callers can classify network failures without parsing the error text. Fixes: microsoft#42532
Node does not always mention the code in the message, e.g. "socket hang up" is an ECONNRESET. Append it during serialization, so that clients in all languages can tell the errors apart.
14b5b2e to
8b04f54
Compare
Test results for "tests 1"6 flaky51374 passed, 1247 skipped Merge workflow run. |
Test results for "MCP"1 failed 8326 passed, 1371 skipped Merge workflow run. |
|
Hi, I'm the Playwright bot and I took a look at the CI failures. 🟢 The one failure is a pre-existing flake — this PR is clear
DetailsThis PR only changes error serialization for Pre-existing flake / infra
Triaged by the Playwright bot — agent run Triaged by the Playwright bot - agent run |
fab00c0
into
microsoft:main
Summary
code,errno,syscall,address,port,hostname— alongside the message, soAPIRequestContextfailures can be classified without parsing the error text.@protocol/serializers, and copied only when the runtime type matches the protocol type.error.codeinto the error message for other languages.Fixes #42532