{"record":{"id":"9a633624dc0cf565","repo":"usebruno/bruno","slug":"windows-proxy-detection-failed-error-instanceof","errorCode":null,"errorMessage":"Windows proxy detection failed: ${error instanceof Error ? error.message : String(error)}","messagePattern":"Windows proxy detection failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-requests/src/network/system-proxy/utils/windows.ts","lineNumber":37,"sourceCode":"        () => this.getSystemProxyEnvironment(execOpts),\n        () => this.getUserEnvironmentProxy(execOpts)\n      ];\n\n      for (const method of detectionMethods) {\n        try {\n          const proxy = await method();\n          if (proxy) {\n            return proxy;\n          }\n        } catch (error) {\n          // Continue to next method if this one fails\n          continue;\n        }\n      }\n\n      throw new Error('No Windows proxy configuration found');\n    } catch (error) {\n      throw new Error(`Windows proxy detection failed: ${error instanceof Error ? error.message : String(error)}`);\n    }\n  }\n\n  private async getInternetOptions(execOpts: ExecFileOptions): Promise<ProxyConfiguration | null> {\n    const stdout = await safeExec('reg', ['query', 'HKCU\\\\Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Internet Settings'], execOpts);\n    if (!stdout) return null;\n\n    const lines = stdout.split('\\n');\n    let proxyEnabled = false;\n    let proxyServer: string | null = null;\n    let proxyOverride: string | null = null;\n    let autoConfigURL: string | null = null;\n\n    for (const line of lines) {\n      const trimmedLine = line.trim();\n\n      if (trimmedLine.includes('ProxyEnable') && trimmedLine.includes('REG_DWORD')) {\n        // Extract the value after REG_DWORD","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-requests/src/network/system-proxy/utils/windows.ts#L19-L55","documentation":"Outer catch in WindowsProxyResolver.detect that wraps any underlying failure (including the 'No Windows proxy configuration found' sentinel) with the 'Windows proxy detection failed:' prefix, preserving the original message as suffix.","triggerScenarios":"reg.exe or netsh spawn failed, command timed out, a detection method threw unexpectedly, or the no-config sentinel propagated up.","commonSituations":"reg.exe not on PATH in a stripped-down Windows container; permission denied reading HKCU; long-running reg query exceeding commandTimeoutMs.","solutions":["Read the suffix to distinguish spawn failures from the no-config case.","Ensure reg.exe and netsh are accessible to the process and the user has rights to HKCU.","Increase commandTimeoutMs via SystemProxyResolver constructor option."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { return await winResolver.detect(); } catch (e) { const m = e.message; if (m.endsWith('No Windows proxy configuration found')) return DIRECT_CONFIG; throw e; }","preventionTips":["Ensure reg.exe/netsh are on PATH and accessible.","Increase commandTimeoutMs if reg queries are slow."],"tags":["proxy","windows","system-proxy","wrapper"],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}