{"record":{"id":"a2681b47bc9d3100","repo":"different-ai/openwork","slug":"failed-to-fetch-latest-mac-yml-response-status","errorCode":null,"errorMessage":"Failed to fetch latest-mac.yml (${response.status} ${response.statusText}).","messagePattern":"Failed to fetch latest-mac\\.yml \\((.+?) (.+?)\\)\\.","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/app/src/app/lib/electron-alpha.ts","lineNumber":75,"sourceCode":"  return {\n    arch,\n    manifestUrl: ELECTRON_ALPHA_LATEST_MAC_YML_URL,\n    releaseUrl: ELECTRON_ALPHA_RELEASE_PAGE_URL,\n    url: resolveArtifactUrl(path),\n    path,\n    version,\n    sha512,\n  };\n}\n\nexport async function resolveElectronAlphaArtifact(\n  arch: \"arm64\" | \"x64\" = \"arm64\",\n): Promise<ElectronAlphaArtifact> {\n  const response = await desktopFetch(ELECTRON_ALPHA_LATEST_MAC_YML_URL, {\n    headers: { Accept: \"text/yaml, text/plain, */*\" },\n  });\n  if (!response.ok) {\n    throw new Error(\n      `Failed to fetch latest-mac.yml (${response.status} ${response.statusText}).`,\n    );\n  }\n  return parseElectronLatestMacYml(await response.text(), arch);\n}\n","sourceCodeStart":57,"sourceCodeEnd":81,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/apps/app/src/app/lib/electron-alpha.ts#L57-L81","documentation":"resolveElectronAlphaArtifact fetches latest-mac.yml via desktopFetch and throws this when the HTTP response is not ok, embedding the status code and status text. It converts a network-level failure into a descriptive error before parsing is attempted.","triggerScenarios":"desktopFetch to ELECTRON_ALPHA_LATEST_MAC_YML_URL returns 404 (artifact removed/moved), 403 (blocked), 5xx (origin error), or any non-2xx status.","commonSituations":"Alpha build purged from storage, wrong channel URL after a repo/rename, corporate proxy or CDN returning errors, offline machine with no cached response.","solutions":["Open the manifest URL in a browser/curl to see the actual status and response body.","If 404, republish the alpha build or point to the correct channel URL.","If 403/451, check proxy/firewall or auth requirements for the storage bucket.","Retry on 5xx with backoff; the failure is often transient."],"exampleFix":"// before: throw immediately on any non-ok status\nif (!response.ok) throw new Error(`Failed to fetch latest-mac.yml (${response.status} ${response.statusText}).`);\n// after: retry transient server errors once\nif (!response.ok && response.status >= 500) {\n  const retry = await desktopFetch(ELECTRON_ALPHA_LATEST_MAC_YML_URL, { headers: { Accept: \"text/yaml, text/plain, */*\" } });\n  if (retry.ok) return parseElectronLatestMacYml(await retry.text(), arch);\n}","handlingStrategy":"retry","validationCode":"const res = await desktopFetch(ELECTRON_ALPHA_LATEST_MAC_YML_URL, { headers: { Accept: \"text/yaml, text/plain, */*\" } });\nif (!res.ok) console.warn(`Manifest endpoint unhealthy: ${res.status} ${res.statusText}`);","typeGuard":null,"tryCatchPattern":"try {\n  const artifact = await resolveElectronAlphaArtifact();\n} catch (err) {\n  if (err instanceof Error && /Failed to fetch latest-mac.yml \\(\\d+/.test(err.message)) {\n    const m = /\\((\\d+)/.exec(err.message);\n    if (m && Number(m[1]) >= 500) scheduleRetryWithBackoff();\n    else showUserFacingUpdateError(err);\n  } else throw err;\n}","preventionTips":["Retry 5xx responses with exponential backoff before surfacing errors.","Distinguish 404 (republish needed) from 5xx (transient) by parsing the status out of the message.","Monitor the manifest URL's uptime so purged artifacts are caught before users hit them."],"tags":["network","http","fetch","electron-updater"],"backgroundTag":"http-request-failed","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}