{"record":{"id":"e2cbb015e7266123","repo":"sickn33/agentic-awesome-skills","slug":"request-failed","errorCode":null,"errorMessage":"Request failed","messagePattern":"Request failed","errorType":"http","errorClass":"ApiError","httpStatus":null,"severity":"error","filePath":"skills/frontend-api-integration-patterns/SKILL.md","lineNumber":72,"sourceCode":"    this.name = \"ApiError\";\n    this.status = status;\n    this.payload = payload;\n  }\n}\n\nexport const apiClient = async (url, options = {}) => {\n  const res = await fetch(url, {\n    headers: { \"Content-Type\": \"application/json\" },\n    ...options,\n  });\n\n  if (!res.ok) {\n    let payload = null;\n    try {\n      payload = await res.json();\n    } catch (_) {}\n\n    throw new ApiError(\n      payload?.message || \"Request failed\",\n      res.status,\n      payload\n    );\n  }\n\n  // handle empty responses safely (e.g. 204 No Content)\n  if (res.status === 204) return null;\n\n  const text = await res.text();\n  return text ? JSON.parse(text) : null;\n};\n```\n\n---\n\n### 2. Race-Safe State Management\n","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/sickn33/agentic-awesome-skills/blob/58d857988fcfac6986206bca2b2fe223aa437e4b/skills/frontend-api-integration-patterns/SKILL.md#L54-L90","documentation":"Error \"Request failed\" thrown in sickn33/agentic-awesome-skills.","triggerScenarios":"Thrown at skills/frontend-api-integration-patterns/SKILL.md:72 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":"58d857988fcfac6986206bca2b2fe223aa437e4b","analyzedAt":"2026-08-26T11:55:59.350Z","schemaVersion":2},"datasetVersion":"2026-08-26T14:46:13.012Z"}