{"record":{"id":"b66f801be4de9317","repo":"garrytan/gstack","slug":"proxy-requires-a-url-value","errorCode":null,"errorMessage":"--proxy requires a URL value","messagePattern":"--proxy requires a URL value","errorType":"validation","errorClass":"ProxyConfigError","httpStatus":null,"severity":"error","filePath":"browse/src/cli.ts","lineNumber":796,"sourceCode":"\n/**\n * Strip the global --proxy and --headed flags from args, validate cred policy,\n * and return the resolved config. Exits 1 with a clear hint on policy\n * violations (D9 cred mixing, malformed URL, unsupported scheme).\n *\n * Exported for unit tests.\n */\nexport function extractGlobalFlags(rawArgs: string[], env: NodeJS.ProcessEnv): GlobalFlags {\n  const out: string[] = [];\n  let proxyUrl: string | null = null;\n  let headed = false;\n\n  for (let i = 0; i < rawArgs.length; i++) {\n    const arg = rawArgs[i];\n    if (arg === '--proxy') {\n      const value = rawArgs[i + 1];\n      if (!value) {\n        throw new ProxyConfigError(\n          'usage: --proxy <scheme://[user:pass@]host:port>',\n          '--proxy requires a URL value',\n        );\n      }\n      proxyUrl = value;\n      i++;\n      continue;\n    }\n    if (arg.startsWith('--proxy=')) {\n      proxyUrl = arg.slice('--proxy='.length);\n      continue;\n    }\n    if (arg === '--headed') { headed = true; continue; }\n    out.push(arg);\n  }\n\n  // Compose the canonical proxyUrl with creds resolved from argv+env.\n  let canonicalProxyUrl: string | null = null;","sourceCodeStart":778,"sourceCodeEnd":814,"githubUrl":"https://github.com/garrytan/gstack/blob/94993f74012782fd94416dd44b8314f6363a13a4/browse/src/cli.ts#L778-L814","documentation":"Error \"--proxy requires a URL value\" thrown in garrytan/gstack.","triggerScenarios":"Thrown at browse/src/cli.ts:796 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"}