{"record":{"id":"1f1a56bd9e9232b7","repo":"paperclipai/paperclip","slug":"invalid-github-url","errorCode":null,"errorMessage":"Invalid GitHub URL.","messagePattern":"Invalid GitHub URL\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/company.ts","lineNumber":914,"sourceCode":"      owner: owner!,\n      repo: repo!,\n      ref: ref || \"main\",\n      path: repoPath.join(\"/\"),\n    });\n  }\n\n  if (!looksLikeRepoUrl(trimmed)) {\n    throw new Error(\"GitHub source must be a GitHub or GitHub Enterprise URL, or owner/repo[/path] shorthand.\");\n  }\n  if (!ref) {\n    return trimmed;\n  }\n\n  const url = new URL(trimmed);\n  const hostname = url.hostname;\n  const parts = url.pathname.split(\"/\").filter(Boolean);\n  if (parts.length < 2) {\n    throw new Error(\"Invalid GitHub URL.\");\n  }\n\n  const owner = parts[0]!;\n  const repo = parts[1]!;\n  const existingPath = normalizeGithubImportPath(url.searchParams.get(\"path\"));\n  const existingCompanyPath = normalizeGithubImportPath(url.searchParams.get(\"companyPath\"));\n  if (existingCompanyPath) {\n    return buildGithubImportUrl({ hostname, owner, repo, ref, companyPath: existingCompanyPath });\n  }\n  if (existingPath) {\n    return buildGithubImportUrl({ hostname, owner, repo, ref, path: existingPath });\n  }\n  if (parts[2] === \"tree\") {\n    return buildGithubImportUrl({ hostname, owner, repo, ref, path: parts.slice(4).join(\"/\") });\n  }\n  if (parts[2] === \"blob\") {\n    return buildGithubImportUrl({ hostname, owner, repo, ref, companyPath: parts.slice(4).join(\"/\") });\n  }","sourceCodeStart":896,"sourceCodeEnd":932,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/cli/src/commands/client/company.ts#L896-L932","documentation":"The GitHub URL passed normalization but its pathname has fewer than two segments, so owner and repo cannot be extracted; a generic guard inside normalizeGithubImportSource for malformed repo URLs.","triggerScenarios":"Thrown at cli/src/commands/client/company.ts:914 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the URL format; use https://github.com/owner/repo or a valid GitHub Enterprise URL."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}