{"record":{"id":"3e440e16fc7ca7c5","repo":"OtterMind/Chat2DB","slug":"github-api-method-endpoint-failed-respons","errorCode":null,"errorMessage":"GitHub API ${method} ${endpoint} failed (${response.status}): ${JSON.stringify(payload).slice(0, 800)}","messagePattern":"GitHub API (.+?) (.+?) failed \\((.+?)\\): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"script/github/sync-community-project.js","lineNumber":63,"sourceCode":"    this.owner = owner;\n    this.repo = repo;\n    this.apiUrl = apiUrl.replace(/\\/$/, '');\n  }\n\n  async request(endpoint, { method = 'GET', body } = {}) {\n    const response = await fetch(`${this.apiUrl}${endpoint}`, {\n      method,\n      headers: {\n        Accept: 'application/vnd.github+json',\n        Authorization: `Bearer ${this.token}`,\n        'Content-Type': 'application/json',\n        'X-GitHub-Api-Version': '2022-11-28',\n      },\n      body: body === undefined ? undefined : JSON.stringify(body),\n    });\n    const payload = response.status === 204 ? null : await response.json();\n    if (!response.ok) {\n      throw new Error(`GitHub API ${method} ${endpoint} failed (${response.status}): ${JSON.stringify(payload).slice(0, 800)}`);\n    }\n    return payload;\n  }\n\n  async graphql(query, variables) {\n    const payload = await this.request('/graphql', {\n      method: 'POST',\n      body: { query, variables },\n    });\n    if (payload.errors?.length) {\n      throw new Error(`GitHub GraphQL failed: ${JSON.stringify(payload.errors).slice(0, 1000)}`);\n    }\n    return payload.data;\n  }\n\n  getIssue(number) {\n    return this.request(`/repos/${this.owner}/${this.repo}/issues/${number}`);\n  }","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/OtterMind/Chat2DB/blob/5ee1e990e73fbcae1969dc554be254fedb3ab888/script/github/sync-community-project.js#L45-L81","documentation":"Error \"GitHub API ${method} ${endpoint} failed (${response.status}): ${JSON.stringify(payload).slice(0, 800)}\" thrown in OtterMind/Chat2DB.","triggerScenarios":"A REST call to the GitHub API returned a non-2xx status while syncing the community project board.","commonSituations":"See trigger scenarios.","solutions":["Check the HTTP status and payload in the message: 401/403 mean token or permission problems, 404 means a wrong owner/repo/project number, 422 means an invalid request body.","Verify the token has the required scopes (repo, project) and retry with corrected endpoint parameters."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ee1e990e73fbcae1969dc554be254fedb3ab888","analyzedAt":"2026-08-14T07:05:03.077Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}