{"record":{"id":"d87cfebce19eee39","repo":"garrytan/gstack","slug":"bad-request","errorCode":"bad_request","errorMessage":"Invalid profile name: '${profile}'","messagePattern":"Invalid profile name: '(.+?)'","errorType":"validation","errorClass":"CookieImportError","httpStatus":null,"severity":"error","filePath":"browse/src/cookie-import-browser.ts","lineNumber":312,"sourceCode":"\nfunction resolveBrowser(nameOrAlias: string): BrowserInfo {\n  const needle = nameOrAlias.toLowerCase().trim();\n  const found = BROWSER_REGISTRY.find(b =>\n    b.aliases.includes(needle) || b.name.toLowerCase() === needle\n  );\n  if (!found) {\n    const supported = BROWSER_REGISTRY.flatMap(b => b.aliases).join(', ');\n    throw new CookieImportError(\n      `Unknown browser '${nameOrAlias}'. Supported: ${supported}`,\n      'unknown_browser',\n    );\n  }\n  return found;\n}\n\nfunction validateProfile(profile: string): void {\n  if (/[/\\\\]|\\.\\./.test(profile) || /[\\x00-\\x1f]/.test(profile)) {\n    throw new CookieImportError(\n      `Invalid profile name: '${profile}'`,\n      'bad_request',\n    );\n  }\n}\n\nfunction getHostPlatform(): BrowserPlatform | null {\n  const p = process.platform;\n  if (p === 'darwin' || p === 'linux' || p === 'win32') return p as BrowserPlatform;\n  return null;\n}\n\nfunction getSearchPlatforms(): BrowserPlatform[] {\n  const current = getHostPlatform();\n  const order: BrowserPlatform[] = [];\n  if (current) order.push(current);\n  for (const platform of ['darwin', 'linux', 'win32'] as BrowserPlatform[]) {\n    if (!order.includes(platform)) order.push(platform);","sourceCodeStart":294,"sourceCodeEnd":330,"githubUrl":"https://github.com/garrytan/gstack/blob/94993f74012782fd94416dd44b8314f6363a13a4/browse/src/cookie-import-browser.ts#L294-L330","documentation":"Error \"Invalid profile name: '${profile}'\" thrown in garrytan/gstack.","triggerScenarios":"Thrown at browse/src/cookie-import-browser.ts:312 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":"94993f74012782fd94416dd44b8314f6363a13a4","analyzedAt":"2026-08-12T04:06:23.140Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}