{"record":{"id":"40e4069a8b5a7434","repo":"anuraghazra/github-readme-stats","slug":"organization-repository-not-found","errorCode":null,"errorMessage":"Organization Repository Not found","messagePattern":"Organization Repository Not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/fetchers/repo.js","lineNumber":106,"sourceCode":"  const isUser = data.organization === null && data.user;\n  const isOrg = data.user === null && data.organization;\n\n  if (isUser) {\n    if (!data.user.repository || data.user.repository.isPrivate) {\n      throw new Error(\"User Repository Not found\");\n    }\n    return {\n      ...data.user.repository,\n      starCount: data.user.repository.stargazers.totalCount,\n    };\n  }\n\n  if (isOrg) {\n    if (\n      !data.organization.repository ||\n      data.organization.repository.isPrivate\n    ) {\n      throw new Error(\"Organization Repository Not found\");\n    }\n    return {\n      ...data.organization.repository,\n      starCount: data.organization.repository.stargazers.totalCount,\n    };\n  }\n\n  throw new Error(\"Unexpected behavior\");\n};\n\nexport { fetchRepo };\nexport default fetchRepo;\n","sourceCodeStart":88,"sourceCodeEnd":119,"githubUrl":"https://github.com/anuraghazra/github-readme-stats/blob/54a7985aeefda00d5eadb55b80c17c7f976c37d2/src/fetchers/repo.js#L88-L119","documentation":"Generic Error thrown by fetchRepo in the isOrg branch (data.user === null && data.organization truthy) when data.organization.repository is null/undefined OR isPrivate is true. Mirrors the user-repo check but for organization-owned repositories — the org exists, but the repo is missing or private.","triggerScenarios":"The login resolves as an organization, but the repo does not exist under that org, or it exists and is private. Same isPrivate semantics as the user branch: a private repo with a public-scoped token is indistinguishable from a missing one.","commonSituations":"Org repo was renamed, transferred out, or set to private; typo in the repo name; or attempting to pin an internal/private org repo without an authorized token.","solutions":["Verify the org + repo path at https://github.com/<org>/<repo>.","Fix typos/renames in the repo param.","If the repo is private, supply a PAT_1 with repo scope (project is intended for public repos)."],"exampleFix":"// before\n// GET /api/pin?username=microsoft&repo=vscodee  (typo)\n\n// after\n// GET /api/pin?username=microsoft&repo=vscode","handlingStrategy":"try-catch","validationCode":"async function orgRepoIsPublic(org, repo, token) {\n  const r = await fetch(`https://api.github.com/repos/${org}/${repo}`, {\n    headers: { Authorization: `token ${token}` },\n  });\n  if (!r.ok) return false;\n  const j = await r.json();\n  return j.private === false;\n}","typeGuard":null,"tryCatchPattern":"try {\n  return await fetchRepo(username, repo);\n} catch (err) {\n  if (err.message === \"Organization Repository Not found\") return null;\n  throw err;\n}","preventionTips":["Verify org + repo at https://github.com/<org>/<repo> first.","Account for transfers: an org repo may move to a user (or vice versa), changing which branch resolves."],"tags":["repo-card","not-found","private-repo","organization","github-api"],"backgroundTag":null,"analyzedSha":"54a7985aeefda00d5eadb55b80c17c7f976c37d2","analyzedAt":"2026-08-12T23:20:41.776Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}