{"record":{"id":"9bad28b7370bcfa5","repo":"affaan-m/ECC","slug":"release-lookup-failed-response-status","errorCode":null,"errorMessage":"release lookup failed (${response.status})","messagePattern":"release lookup failed \\((.+?)\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/discord/release-announce.mjs","lineNumber":47,"sourceCode":"async function githubGraphql(query, variables) {\n  const response = await request('https://api.github.com/graphql', {\n    method: 'POST',\n    headers: { Authorization: `Bearer ${env.GITHUB_TOKEN}`, 'Content-Type': 'application/json' },\n    body: JSON.stringify({ query, variables }),\n  });\n  if (!response.ok) throw new Error(`GitHub GraphQL request failed (${response.status})`);\n  const payload = await response.json();\n  if (payload.errors) throw new Error('GitHub GraphQL returned errors');\n  return payload.data;\n}\n\nasync function releaseFromGitHub() {\n  const [owner, repo] = env.GITHUB_REPOSITORY.split('/');\n  const tag = env.RELEASE_TAG || env.GITHUB_REF_NAME;\n  const response = await request(`https://api.github.com/repos/${owner}/${repo}/releases/tags/${encodeURIComponent(tag)}`, {\n    headers: { Authorization: `Bearer ${env.GITHUB_TOKEN}`, Accept: 'application/vnd.github+json' },\n  });\n  if (!response.ok) throw new Error(`release lookup failed (${response.status})`);\n  return response.json();\n}\n\nasync function createOrFindReleaseDiscussion() {\n  const release = await releaseFromGitHub();\n  const [owner, name] = env.GITHUB_REPOSITORY.split('/');\n  const marker = releaseMarker(release.tag_name);\n  const data = await githubGraphql(\n    `query($owner:String!,$name:String!){repository(owner:$owner,name:$name){id discussionCategories(first:25){nodes{id name}}}}`,\n    { owner, name },\n  );\n  const repository = data.repository;\n  let cursor = null;\n  let existing = null;\n  for (let page = 0; page < 50 && !existing; page += 1) {\n    const pageData = await githubGraphql(\n      `query($owner:String!,$name:String!,$after:String){repository(owner:$owner,name:$name){discussions(first:100,after:$after,orderBy:{field:CREATED_AT,direction:DESC}){nodes{id title body url category{name}} pageInfo{hasNextPage endCursor}}}}`,\n      { owner, name, after: cursor },","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/affaan-m/ECC/blob/06c5e118c4d3e6c3b7f9445f973a2194c82de193/scripts/discord/release-announce.mjs#L29-L65","documentation":"Thrown by releaseFromGitHub when the GitHub API release lookup returns a non-OK HTTP status (e.g. 404 for a missing tag, 401 for a bad token). The announcement cannot be built without the release payload.","triggerScenarios":"Triggered when release-announce.mjs rejects the current invocation: release lookup failed (<value>)","commonSituations":"Occurs while running scripts/discord/release-announce.mjs with invalid arguments, missing flags, or a failing external dependency; the guard at scripts/discord/release-announce.mjs:47 aborts the command with this message.","solutions":["Inspect the underlying error detail in the message (stderr/log/HTTP status), fix the cause, and retry."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06c5e118c4d3e6c3b7f9445f973a2194c82de193","analyzedAt":"2026-08-18T11:27:13.915Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}