{"record":{"id":"1dc5b391a423f2e2","repo":"diegosouzapw/OmniRoute","slug":"device-code-request-failed-error","errorCode":null,"errorMessage":"Device code request failed: ${error}","messagePattern":"Device code request failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/oauth/providers/ghe-copilot.ts","lineNumber":38,"sourceCode":"export const gheCopilot = {\n  config: GHE_COPILOT_CONFIG,\n  flowType: \"device_code\" as const,\n  requestDeviceCode: async (config: any) => {\n    const gheUrl = normalizeGheUrl(config.gheUrl);\n    const response = await fetch(`${gheUrl}/login/device/code`, {\n      method: \"POST\",\n      headers: {\n        \"Content-Type\": \"application/x-www-form-urlencoded\",\n        Accept: \"application/json\",\n      },\n      body: new URLSearchParams({\n        client_id: config.clientId,\n        scope: config.scopes,\n      }),\n    });\n    if (!response.ok) {\n      const error = await response.text();\n      throw new Error(`Device code request failed: ${error}`);\n    }\n    return await response.json();\n  },\n  pollToken: async (config: any, deviceCode: string, _codeVerifier?: string, extraData?: any) => {\n    const gheUrl = normalizeGheUrl(extraData?.gheUrl || config.gheUrl);\n    const response = await fetch(`${gheUrl}/login/oauth/access_token`, {\n      method: \"POST\",\n      headers: {\n        \"Content-Type\": \"application/x-www-form-urlencoded\",\n        Accept: \"application/json\",\n      },\n      body: new URLSearchParams({\n        client_id: config.clientId,\n        device_code: deviceCode,\n        grant_type: \"urn:ietf:params:oauth:grant-type:device_code\",\n      }),\n    });\n    let data;","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/oauth/providers/ghe-copilot.ts#L20-L56","documentation":"Error \"Device code request failed: ${error}\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/oauth/providers/ghe-copilot.ts:38 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":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}