Bug Description
Regression of #4273. The test
|
t.assert.ok(ev.error instanceof TypeError) |
passes, but there is no
cause with ECONNREFUSED on the error.
Reproducible By
import { WebSocket } from 'undici';
// No actual server here
const ws = new WebSocket('ws://localhost:1234');
ws.addEventListener('error', (event) => {
console.log('TypeError', event.error instanceof TypeError);
console.log('error.cause', event.error?.cause);
});
Expected Behavior
Error should have a cause with the network error.
Logs & Screenshots
N/A
Environment
macOS Tahoe 26.4. Node.js 22.22.1. Undici 8.0.2.
Additional context
N/A
Bug Description
Regression of #4273. The test
undici/test/websocket/issue-4273.js
Line 13 in 4f4bf4f
causewith ECONNREFUSED on the error.Reproducible By
Expected Behavior
Error should have a cause with the network error.
Logs & Screenshots
N/A
Environment
macOS Tahoe 26.4. Node.js 22.22.1. Undici 8.0.2.
Additional context
N/A