mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-29 14:30:52 +00:00
fix(web-app-docs): keep the poll failure attached to the transport error
pollStatus catches an expect.poll failure, appends the last transport error it saw and throws a fresh Error. Without a cause the original failure and its stack were dropped, so a Playwright report showed the composed text and no longer what the poll actually tripped over, which is the interesting half on a Tor run. eslint's preserve-caught-error was the only error in lint-javascript. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
227552edae
commit
69a86b0f17
1 file changed
+4
-1
@@ -29,7 +29,10 @@ async function pollStatus(request, url, expected, message, timeout) {
|
||||
.toBe(expected);
|
||||
} catch (failure) {
|
||||
if (!lastTransportError) throw failure;
|
||||
throw new Error(`${failure.message}\nlast transport error reaching ${url}: ${lastTransportError.message}`);
|
||||
throw new Error(
|
||||
`${failure.message}\nlast transport error reaching ${url}: ${lastTransportError.message}`,
|
||||
{ cause: failure },
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user