{"record":{"id":"0185046c2fe4cb78","repo":"discourse/discourse","slug":"download-failed-response-status","errorCode":null,"errorMessage":"Download failed: ${response.status}","messagePattern":"Download failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"frontend/discourse/app/lib/download-blob.js","lineNumber":54,"sourceCode":"  }\n  a.rel = \"noopener\";\n  document.body.appendChild(a);\n  a.click();\n  document.body.removeChild(a);\n  setTimeout(() => URL.revokeObjectURL(objectUrl), REVOKE_AFTER);\n}\n\n// Fetches `url` and triggers a browser download of the response body.\nexport default async function downloadBlob(\n  url,\n  { fallbackFilename, fetchOptions } = {}\n) {\n  const response = await fetch(url, {\n    credentials: \"same-origin\",\n    ...fetchOptions,\n  });\n  if (!response.ok) {\n    throw new Error(`Download failed: ${response.status}`);\n  }\n  triggerBlobDownload(await response.blob(), {\n    fallbackFilename,\n    contentDisposition: response.headers.get(\"Content-Disposition\"),\n  });\n}\n","sourceCodeStart":36,"sourceCodeEnd":61,"githubUrl":"https://github.com/discourse/discourse/blob/1b2d7253e854205d2c95c80b2c6a1cdd42e45059/frontend/discourse/app/lib/download-blob.js#L36-L61","documentation":"Error \"Download failed: ${response.status}\" thrown in discourse/discourse.","triggerScenarios":"Thrown at frontend/discourse/app/lib/download-blob.js:54 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":"1b2d7253e854205d2c95c80b2c6a1cdd42e45059","analyzedAt":"2026-08-26T03:11:08.302Z","schemaVersion":2},"datasetVersion":"2026-08-26T07:17:17.940Z"}