Kong/insomnia · error
( )
Error message
${err.message} (${detail}) What it means
Wrapper in insomniaFetch for fetch-level failures: the message combines the fetch error with the underlying cause detail (ECONNREFUSED, TLS/cert problems, DNS failures) hiding in err.cause, sometimes nested in an AggregateError.
Solutions
- Read the (detail) suffix to find the real OS-level error
- Fix connectivity: server reachable, valid certificates, correct proxy settings
- Retry transient connection failures
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at packages/insomnia/src/common/insomnia-fetch.ts:94 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Kong/insomnia@d9bb2b0142 (2026-08-26).
Data as JSON: /api/errors/d8692b5f64811c6a.
Report an issue: GitHub.
Appendix: source
Thrown at packages/insomnia/src/common/insomnia-fetch.ts:94
}
throw new ResponseFailError(errName, errMsg, response);
}
return isJson ? response.json() : (response.text() as Promise<T>);
} catch (err) {
if (!(err instanceof Error)) {
throw err;
}
// AbortSignal.timeout() gives TimeoutError, not AbortError
if (err.name === 'AbortError' || err.name === 'TimeoutError') {
throw new Error(`insomniaFetch timed out: ${method} ${path}`, { cause: err });
}
// the real error (ECONNREFUSED, cert problems) hides in err.cause, sometimes nested in an AggregateError
const cause = (err as { cause?: string | { code?: string; message?: string; errors?: { code?: string }[] } })
.cause;
const detail = typeof cause === 'string' ? cause : cause?.code || cause?.errors?.[0]?.code || cause?.message;
if (detail) {
// fresh Error (don't mutate err.message) so a re-observed/retried error doesn't append the detail twice
throw new Error(`${err.message} (${detail})`, { cause: err });
}
throw err;
}
}
View on GitHub (pinned to d9bb2b0142)