{"record":{"id":"a2293add60c0f32b","repo":"oven-sh/bun","slug":"read-failed-absolutepath","errorCode":null,"errorMessage":"Read failed: ${absolutePath}","messagePattern":"Read failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/utils.mjs","lineNumber":932,"sourceCode":" * @param {object} [options]\n * @param {boolean} [options.cache]\n * @returns {string}\n */\nexport function readFile(filename, options = {}) {\n  const absolutePath = resolve(filename);\n  if (options[\"cache\"]) {\n    if (cachedFiles?.[absolutePath]) {\n      return cachedFiles[absolutePath];\n    }\n  }\n\n  debugLog(\"$\", \"cat\", absolutePath);\n\n  let content;\n  try {\n    content = readFileSync(absolutePath, \"utf-8\");\n  } catch (cause) {\n    throw new Error(`Read failed: ${absolutePath}`, { cause });\n  }\n\n  if (options[\"cache\"]) {\n    cachedFiles ||= {};\n    cachedFiles[absolutePath] = content;\n  }\n\n  return content;\n}\n\n/**\n * @param {string} path\n * @param {number} mode\n */\nexport function chmod(path, mode) {\n  debugLog(\"$\", \"chmod\", path, mode);\n  chmodSync(path, mode);\n}","sourceCodeStart":914,"sourceCodeEnd":950,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/scripts/utils.mjs#L914-L950","documentation":"Error \"Read failed: ${absolutePath}\" thrown in oven-sh/bun.","triggerScenarios":"Thrown at scripts/utils.mjs:932 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":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}