{"record":{"id":"e2b0d0d7f80ebffa","repo":"paperclipai/paperclip","slug":"company-selector-is-required","errorCode":null,"errorMessage":"Company selector is required.","messagePattern":"Company selector is required\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/client/company.ts","lineNumber":1279,"sourceCode":"  });\n\n  if (p.isCancel(confirmed) || !confirmed) {\n    throw new Error(\"Export cancelled.\");\n  }\n}\n\nfunction matchesPrefix(company: Company, selector: string): boolean {\n  return company.issuePrefix.toUpperCase() === selector.toUpperCase();\n}\n\nexport function resolveCompanyForDeletion(\n  companies: Company[],\n  selectorRaw: string,\n  by: CompanyDeleteSelectorMode = \"auto\",\n): Company {\n  const selector = normalizeSelector(selectorRaw);\n  if (!selector) {\n    throw new Error(\"Company selector is required.\");\n  }\n\n  const idMatch = companies.find((company) => company.id === selector);\n  const prefixMatch = companies.find((company) => matchesPrefix(company, selector));\n\n  if (by === \"id\") {\n    if (!idMatch) {\n      throw new Error(`No company found by ID '${selector}'.`);\n    }\n    return idMatch;\n  }\n\n  if (by === \"prefix\") {\n    if (!prefixMatch) {\n      throw new Error(`No company found by shortname/prefix '${selector}'.`);\n    }\n    return prefixMatch;\n  }","sourceCodeStart":1261,"sourceCodeEnd":1297,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/cli/src/commands/client/company.ts#L1261-L1297","documentation":"resolveCompanyForDeletion normalized the selector argument to an empty string, so there is no company ID or issue prefix to match against.","triggerScenarios":"Thrown at cli/src/commands/client/company.ts:1279 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a company selector argument (company ID or issue prefix)."],"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"}