{"record":{"id":"1236fd55909a7fc3","repo":"continuedev/continue","slug":"error-getting-context-items-from-greptile","errorCode":null,"errorMessage":"Error getting context items from Greptile","messagePattern":"Error getting context items from Greptile","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/context/providers/GreptileContextProvider.ts","lineNumber":101,"sourceCode":"      if (!response.ok) {\n        throw new Error(`HTTP error! status: ${response.status}`);\n      }\n\n      // Parse the response as JSON\n      try {\n        const json = JSON.parse(rawText);\n        return json.sources.map((source: any) => ({\n          description: source.filepath,\n          content: `File: ${source.filepath}\\nLines: ${source.linestart}-${source.lineend}\\n\\n${source.summary}`,\n          name:\n            (source.filepath.split(\"/\").pop() ?? \"\").split(\"\\\\\").pop() ?? \"\",\n        }));\n      } catch (jsonError) {\n        throw new Error(`Failed to parse Greptile response:\\n${rawText}`);\n      }\n    } catch (error) {\n      console.error(\"Error getting context items from Greptile:\", error);\n      throw new Error(\"Error getting context items from Greptile\");\n    }\n  }\n\n  private getGreptileToken(): string | undefined {\n    return this.options.GreptileToken || process.env.GREPTILE_AUTH_TOKEN;\n  }\n\n  private getGithubToken(): string | undefined {\n    return this.options.GithubToken || process.env.GITHUB_TOKEN;\n  }\n\n  private async getWorkspaceDir(\n    extras: ContextProviderExtras,\n  ): Promise<string | null> {\n    try {\n      const workspaceDirs = await extras.ide.getWorkspaceDirs();\n      if (workspaceDirs && workspaceDirs.length > 0) {\n        return workspaceDirs[0];","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/core/context/providers/GreptileContextProvider.ts#L83-L119","documentation":"Catch-all thrown from the outer try in getContextItems: any failure inside the Greptile flow (token checks aside), including fetch errors, HTTP errors (26), and JSON parse errors (27), is logged via console.error and rethrown with this generic message. The original error detail is lost to the caller.","triggerScenarios":"Any exception in the Greptile network/mapping block: network down, HTTP error status, JSON parse failure, or TypeError while mapping sources.","commonSituations":"Offline machine, expired token causing 401, or API response shape change — user only sees the generic message unless they check backend logs.","solutions":["Check the Continue backend console for the 'Error getting context items from Greptile:' log line with the real cause","Fix the underlying issue (network, token, repo indexing) per that log","Consider contributing a rethrow of error instead of a new generic Error to preserve the message"],"exampleFix":"// before\n} catch (error) {\n  console.error('Error getting context items from Greptile:', error);\n  throw new Error('Error getting context items from Greptile');\n}\n// after\n} catch (error) {\n  console.error('Error getting context items from Greptile:', error);\n  throw error instanceof Error ? error : new Error(String(error));\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const items = await greptileProvider.getContextItems(q, extras);\n} catch (e) {\n  if (/Error getting context items from Greptile/.test(e.message)) {\n    // inspect backend logs for the root cause; degrade gracefully\n    return [];\n  }\n  throw e;\n}","preventionTips":["Check backend console logs whenever this generic message appears","Treat Greptile as an optional context source with a fallback pipeline"],"tags":["greptile","wrapper","catch-all"],"backgroundTag":"http-api-error-response","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}