{"record":{"id":"1cc1429694298e19","repo":"Mintplex-Labs/anything-llm","slug":"res-reason","errorCode":null,"errorMessage":"res.reason","messagePattern":"res\\.reason","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"frontend/src/models/dataConnector.js","lineNumber":16,"sourceCode":"import { API_BASE } from \"@/utils/constants\";\nimport { baseHeaders } from \"@/utils/request\";\nimport showToast from \"@/utils/toast\";\n\nconst DataConnector = {\n  github: {\n    branches: async ({ repo, accessToken }) => {\n      return await fetch(`${API_BASE}/ext/github/branches`, {\n        method: \"POST\",\n        headers: baseHeaders(),\n        cache: \"force-cache\",\n        body: JSON.stringify({ repo, accessToken }),\n      })\n        .then((res) => res.json())\n        .then((res) => {\n          if (!res.success) throw new Error(res.reason);\n          return res.data;\n        })\n        .then((data) => {\n          return { branches: data?.branches || [], error: null };\n        })\n        .catch((e) => {\n          console.error(e);\n          showToast(e.message, \"error\");\n          return { branches: [], error: e.message };\n        });\n    },\n    collect: async function ({ repo, accessToken, branch, ignorePaths = [] }) {\n      return await fetch(`${API_BASE}/ext/github/repo`, {\n        method: \"POST\",\n        headers: baseHeaders(),\n        body: JSON.stringify({ repo, accessToken, branch, ignorePaths }),\n      })\n        .then((res) => res.json())","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/frontend/src/models/dataConnector.js#L1-L34","documentation":"Frontend guard in DataConnector.github.branches: the backend responded with JSON where success is false, meaning the GitHub branch-list request was rejected server-side (bad repo, invalid token, upstream failure); res.reason carries the explanatory cause from the server.","triggerScenarios":"Thrown when a data connector request returns a failure reason.","commonSituations":"Misconfigured connector, bad credentials, or external service error.","solutions":["Review the returned reason for the data connector failure.","Verify the data connector configuration and credentials.","Check the external service availability."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}