{"record":{"id":"e2dfcb98ece5d677","repo":"Hmbown/CodeWhale","slug":"too-many-redirects-starting-at-url","errorCode":null,"errorMessage":"too many redirects starting at ${url}","messagePattern":"too many redirects starting at (.+?)","errorType":"exception","errorClass":"NonRetryableError","httpStatus":null,"severity":"error","filePath":"npm/codewhale/scripts/install.js","lineNumber":866,"sourceCode":"// Public download primitives (now retry + progress aware)\n// ────────────────────────────────────────────────────────────────────────────\n\nasync function followRedirects(url, opts = {}) {\n  const maxRedirects = 10;\n  let current = url;\n  for (let hop = 0; hop < maxRedirects; hop++) {\n    const result = await httpRequest(current, opts);\n    if (result.redirect) {\n      try {\n        current = new URL(result.redirect, current).toString();\n      } catch {\n        current = result.redirect;\n      }\n      continue;\n    }\n    return result;\n  }\n  throw new NonRetryableError(`too many redirects starting at ${url}`);\n}\n\nfunction streamToFile(response, destination, progress) {\n  return new Promise((resolve, reject) => {\n    const sink = createWriteStream(destination);\n    let done = false;\n    const finish = (err) => {\n      if (done) return;\n      done = true;\n      if (err) {\n        sink.destroy();\n        reject(err);\n      } else {\n        resolve();\n      }\n    };\n    response.on(\"data\", (chunk) => {\n      if (progress) progress.onChunk(chunk.length);","sourceCodeStart":848,"sourceCodeEnd":884,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/npm/codewhale/scripts/install.js#L848-L884","documentation":"Error \"too many redirects starting at ${url}\" thrown in Hmbown/CodeWhale.","triggerScenarios":"Thrown at npm/codewhale/scripts/install.js:866 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":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}