{"record":{"id":"d8692b5f64811c6a","repo":"Kong/insomnia","slug":"err-message-detail","errorCode":null,"errorMessage":"${err.message} (${detail})","messagePattern":"\\$\\{err\\.message\\} \\(\\$\\{detail\\}\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/insomnia/src/common/insomnia-fetch.ts","lineNumber":94,"sourceCode":"      }\n      throw new ResponseFailError(errName, errMsg, response);\n    }\n    return isJson ? response.json() : (response.text() as Promise<T>);\n  } catch (err) {\n    if (!(err instanceof Error)) {\n      throw err;\n    }\n    // AbortSignal.timeout() gives TimeoutError, not AbortError\n    if (err.name === 'AbortError' || err.name === 'TimeoutError') {\n      throw new Error(`insomniaFetch timed out: ${method} ${path}`, { cause: err });\n    }\n    // the real error (ECONNREFUSED, cert problems) hides in err.cause, sometimes nested in an AggregateError\n    const cause = (err as { cause?: string | { code?: string; message?: string; errors?: { code?: string }[] } })\n      .cause;\n    const detail = typeof cause === 'string' ? cause : cause?.code || cause?.errors?.[0]?.code || cause?.message;\n    if (detail) {\n      // fresh Error (don't mutate err.message) so a re-observed/retried error doesn't append the detail twice\n      throw new Error(`${err.message} (${detail})`, { cause: err });\n    }\n    throw err;\n  }\n}\n","sourceCodeStart":76,"sourceCodeEnd":99,"githubUrl":"https://github.com/Kong/insomnia/blob/d9bb2b0142600f21309832daea3317942d285984/packages/insomnia/src/common/insomnia-fetch.ts#L76-L99","documentation":"Error \"${err.message} (${detail})\" thrown in Kong/insomnia.","triggerScenarios":"Thrown at packages/insomnia/src/common/insomnia-fetch.ts:94 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d9bb2b0142600f21309832daea3317942d285984","analyzedAt":"2026-08-26T18:04:05.187Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}