Kong/insomnia · error · ResponseFailError

${errName}: ${errMsg}

Error message

${errName}: ${errMsg}

What it means

Error "${errName}: ${errMsg}" thrown in Kong/insomnia.

Source

Thrown at packages/insomnia/src/common/insomnia-fetch.ts:77

    if (uri && onDeepLink) {
      onDeepLink(uri);
    }
    const isJson = response.headers.get('content-type')?.includes('application/json') || path.match(/\.json$/);
    if (!response.ok) {
      let errName = `CODE-${response.status}`;
      let errMsg = response.statusText;
      if (isJson) {
        try {
          const json = await response.json();
          if (typeof json?.error === 'string') {
            errName = json.error;
          }
          if (typeof json?.message === 'string') {
            errMsg = json.message;
          }
        } catch {}
      }
      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 });
    }

View on GitHub (pinned to d9bb2b0142)

When it happens

Trigger: Thrown at packages/insomnia/src/common/insomnia-fetch.ts:77 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/a4dd20fb621adb9d. Report an issue: GitHub.