Files
2026-07-22 18:08:04 -05:00

18 lines
585 B
JavaScript

// Probes the network-failure rejection's CAUSE from package code — the
// exact consumer shape: provider-utils' handleFetchError classifies
// retryable network errors by error.cause.message/.code.
export async function probeRefused(url) {
try {
await fetch(url);
console.log("unexpectedly connected");
} catch (e) {
console.log(`err ${e.name}: ${e.message}`);
const c = e.cause;
if (c instanceof Error) {
console.log(`cause ${c.message} code=${c.code} syscall=${c.syscall}`);
} else {
console.log(`cause missing: ${String(c)}`);
}
}
}