{"record":{"id":"19ec23cf571e6895","repo":"ruvnet/ruflo","slug":"failed-to-fetch-res-status","errorCode":null,"errorMessage":"Failed to fetch (${res.status})","messagePattern":"Failed to fetch \\((.+?)\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ruflo/src/ruvocal/src/lib/components/chat/UrlFetchModal.svelte","lineNumber":83,"sourceCode":"\t}\n\n\tasync function handleSubmit() {\n\t\terrorMsg = \"\";\n\t\tconst trimmed = urlValue.trim();\n\t\tif (!isHttpsUrl(trimmed)) {\n\t\t\terrorMsg = \"Enter a valid HTTPS URL.\";\n\t\t\treturn;\n\t\t}\n\t\tloading = true;\n\t\ttry {\n\t\t\t// Use server proxy directly for one URL to validate size/types before creating File\n\t\t\tconst params = new URLSearchParams({ url: trimmed });\n\t\t\tif (acceptMimeTypes.length > 0) params.set(\"accept\", acceptMimeTypes.join(\",\"));\n\t\t\tconst proxyUrl = `${base}/api/fetch-url?${params}`;\n\t\t\tconst res = await fetch(proxyUrl);\n\t\t\tif (!res.ok) {\n\t\t\t\tconst txt = await res.text();\n\t\t\t\tthrow new Error(txt || `Failed to fetch (${res.status})`);\n\t\t\t}\n\t\t\tconst forwardedType = res.headers.get(\"x-forwarded-content-type\");\n\t\t\tconst blob = await res.blob();\n\t\t\tconst mimeType = pickSafeMime(forwardedType, blob.type, trimmed);\n\t\t\t// Optional client-side mime filter (same wildcard semantics as dropzone)\n\t\t\tif (acceptMimeTypes.length > 0 && mimeType && !matchesAllowed(mimeType, acceptMimeTypes)) {\n\t\t\t\tthrow new Error(\"File type not allowed.\");\n\t\t\t}\n\t\t\tconst disp = res.headers.get(\"content-disposition\");\n\t\t\tconst filename = (() => {\n\t\t\t\tconst filenameStar = disp?.match(/filename\\*=UTF-8''([^;]+)/i)?.[1];\n\t\t\t\tif (filenameStar) {\n\t\t\t\t\tconst cleaned = filenameStar.trim().replace(/['\"]/g, \"\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn decodeURIComponent(cleaned);\n\t\t\t\t\t} catch {\n\t\t\t\t\t\treturn cleaned;\n\t\t\t\t\t}","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/ruflo/src/ruvocal/src/lib/components/chat/UrlFetchModal.svelte#L65-L101","documentation":"The URL-fetch proxy request returned a non-OK HTTP status, and the response body was empty, so handleSubmit() synthesized this error with the proxy's status code. The server-side /api/fetch-url proxy refused or failed the fetch (bad URL upstream, size/type rejection, or proxy error) — not a client-side URL-format problem, which was validated earlier.","triggerScenarios":"Thrown at ruflo/src/ruvocal/src/lib/components/chat/UrlFetchModal.svelte:83 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the URL and network connectivity; inspect the HTTP status code for the underlying cause.","Retry with backoff for transient failures; surface the status code to the user for 4xx responses."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}